From: Matt Birkholz Date: Mon, 12 Jan 2026 16:43:37 +0000 (-0700) Subject: Set 15min expiration on tellurion.png, any .png in /Tellurion/. X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=859a973784745124169e1730fd12f4e05b20d08f;p=Network.git Set 15min expiration on tellurion.png, any .png in /Tellurion/. --- diff --git a/README.org b/README.org index 28f9af1..6b27b69 100644 --- a/README.org +++ b/README.org @@ -498,6 +498,40 @@ AliasMatch /Photos/(20[0-9][0-9])_([0-9][0-9])_([0-9][0-9])/$ \ AliasMatch /Photos/$ {{ docroot }}/Photos/index.html #+END_SRC +** Configure Tellurion Expiration on Front + +The abbey's =tellurion.png= is updated every 15 minutes on the quarter +hour, and should expire soon thereafter. To accomplish this, Apache's +~expires~ module is enabled inside the =/Tellurion/= directory and the +=tellurion.png= uploaded there. + +#+NAME: apache-tellurion +#+CAPTION: ~apache-tellurion~ +#+BEGIN_SRC conf + + ExpiresActive On + ExpiresByType image/png "modification plus 15 minutes" + +#+END_SRC + +Apache's Expires module must be enabled before the above directives +will be accepted. + +#+CAPTION: [[file:roles_t/abbey-front/tasks/main.yml][=roles_t/abbey-front/tasks/main.yml]] +#+BEGIN_SRC conf :tangle roles_t/abbey-front/tasks/main.yml :noweb no-export + +<> +#+END_SRC + +#+NAME: tellurion-tasks +#+CAPTION: ~tellurion-tasks~ +#+BEGIN_SRC conf +- name: Enable Apache2 expires module. + become: yes + apache2_module: name=expires + notify: Restart Apache2. +#+END_SRC + ** Configure Apache on Front The abbey needs to add some Apache2 configuration directives to the @@ -506,11 +540,11 @@ Luckily there is support for this in the institutional configuration. The abbey simply creates a =birchwood-abbey.net-vhost.conf= file in =/etc/apache2/sites-available/=. -The following task adds the [[apache-abbey][~apache-abbey~]], [[apache-photos][~apache-photos~]], and -[[apache-gitweb][~apache-gitweb~]] directives described above to the =-vhost.conf= file, -and includes =options-ssl-apache.conf= from =/etc/letsencrypt/=. The -rest of the Let's Encrypt configuration is discussed in the following -[[*Install Let's Encrypt][Install Let's Encrypt]] section. +The following task adds the [[apache-gitweb][~apache-gitweb~]], [[apache-abbey][~apache-abbey~]], +[[apache-photos][~apache-photos~]], and [[apache-tellurion][~apache-tellurion~]] directives described above to +the =-vhost.conf= file, and includes =options-ssl-apache.conf= from +=/etc/letsencrypt/=. The rest of the Let's Encrypt configuration is +discussed in the following [[*Install Let's Encrypt][Install Let's Encrypt]] section. #+CAPTION: [[file:roles_t/abbey-front/tasks/main.yml][=roles_t/abbey-front/tasks/main.yml=]] #+BEGIN_SRC conf :tangle roles_t/abbey-front/tasks/main.yml :noweb no-export @@ -527,6 +561,8 @@ rest of the Let's Encrypt configuration is discussed in the following <> + <> + IncludeOptional /etc/letsencrypt/options-ssl-apache.conf dest: /etc/apache2/sites-available/birchwood-abbey.net-vhost.conf notify: Restart Apache2. @@ -1024,12 +1060,24 @@ Front]] for more information. <> #+END_SRC +** Configure Tellurion Expiration on Core + +The ~apache-tellurion~ directives are defined [[apache-tellurion][here]] and included in the +Apache configuration below. The ~tellurion-tasks~ are defined [[tellurion-tasks][here]] +and included by the following code block. + +#+CAPTION: [[file:roles_t/abbey-core/tasks/main.yml][=roles_t/abbey-core/tasks/main.yml]] +#+BEGIN_SRC conf :tangle roles_t/abbey-core/tasks/main.yml :noweb no-export + +<> +#+END_SRC + ** Configure Apache on Core The Apache2 configuration on Core specifies three web sites (live, test, and campus). The live and test sites must operate just like the -site on Front. Their configurations include the same [[apache-abbey][~apache-abbey~]], -[[apache-photos][~apache-photos~]], and [[apache-gitweb][~apache-gitweb~]] used on Front. +site on Front. Their configurations include the same [[apache-gitweb][~apache-gitweb~]], +[[apache-abbey][~apache-abbey~]], [[apache-photos][~apache-photos~]], and [[apache-tellurion][~apache-tellurion~]] used on Front. #+CAPTION: [[file:roles_t/abbey-core/tasks/main.yml][=roles_t/abbey-core/tasks/main.yml=]] #+BEGIN_SRC conf :tangle roles_t/abbey-core/tasks/main.yml :noweb no-export @@ -1045,6 +1093,8 @@ site on Front. Their configurations include the same [[apache-abbey][~apache-ab <> <> + + <> dest: /etc/apache2/sites-available/live-vhost.conf mode: u=rw,g=r,o=r notify: Restart Apache2. @@ -1060,6 +1110,8 @@ site on Front. Their configurations include the same [[apache-abbey][~apache-ab <> <> + + <> dest: /etc/apache2/sites-available/test-vhost.conf mode: u=rw,g=r,o=r notify: Restart Apache2. diff --git a/roles_t/abbey-core/tasks/main.yml b/roles_t/abbey-core/tasks/main.yml index b6700db..316f850 100644 --- a/roles_t/abbey-core/tasks/main.yml +++ b/roles_t/abbey-core/tasks/main.yml @@ -129,6 +129,11 @@ dest: /etc/gitweb.conf mode: u=rw,g=r,o=r +- name: Enable Apache2 expires module. + become: yes + apache2_module: name=expires + notify: Restart Apache2. + - name: Configure live website. become: yes vars: @@ -159,6 +164,11 @@ AliasMatch /Photos/(20[0-9][0-9])_([0-9][0-9])_([0-9][0-9])/$ \ {{ docroot }}/Photos/$1/$2/$3/index.html AliasMatch /Photos/$ {{ docroot }}/Photos/index.html + + + ExpiresActive On + ExpiresByType image/png "modification plus 15 minutes" + dest: /etc/apache2/sites-available/live-vhost.conf mode: u=rw,g=r,o=r notify: Restart Apache2. @@ -193,6 +203,11 @@ AliasMatch /Photos/(20[0-9][0-9])_([0-9][0-9])_([0-9][0-9])/$ \ {{ docroot }}/Photos/$1/$2/$3/index.html AliasMatch /Photos/$ {{ docroot }}/Photos/index.html + + + ExpiresActive On + ExpiresByType image/png "modification plus 15 minutes" + dest: /etc/apache2/sites-available/test-vhost.conf mode: u=rw,g=r,o=r notify: Restart Apache2. diff --git a/roles_t/abbey-front/tasks/main.yml b/roles_t/abbey-front/tasks/main.yml index 1f66749..8f05f4e 100644 --- a/roles_t/abbey-front/tasks/main.yml +++ b/roles_t/abbey-front/tasks/main.yml @@ -128,6 +128,11 @@ dest: /etc/gitweb.conf mode: u=rw,g=r,o=r +- name: Enable Apache2 expires module. + become: yes + apache2_module: name=expires + notify: Restart Apache2. + - name: Configure Apache. become: yes vars: @@ -159,6 +164,11 @@ {{ docroot }}/Photos/$1/$2/$3/index.html AliasMatch /Photos/$ {{ docroot }}/Photos/index.html + + ExpiresActive On + ExpiresByType image/png "modification plus 15 minutes" + + IncludeOptional /etc/letsencrypt/options-ssl-apache.conf dest: /etc/apache2/sites-available/birchwood-abbey.net-vhost.conf notify: Restart Apache2.