Merge lp:~tribaal/ubumirror/add-apache-example-config into lp:ubumirror

Proposed by Chris Glass
Status: Merged
Merged at revision: 69
Proposed branch: lp:~tribaal/ubumirror/add-apache-example-config
Merge into: lp:ubumirror
Diff against target: 52 lines (+42/-0)
2 files modified
apache2-ubuntu-mirror.conf (+41/-0)
debian/ubumirror.examples (+1/-0)
To merge this branch: bzr merge lp:~tribaal/ubumirror/add-apache-example-config
Reviewer Review Type Date Requested Status
Ubumirror Developers Pending
Review via email: mp+222448@code.launchpad.net

Description of the change

This branch adds an example apache2 configuration file.

Note: the configuration file sets cache headers for deb files to public and expiring after 2 weeks, since that will enable web caches to work more efficiently on the path between the apache server and the final user.

Since deb files include a version number in the URL, it is very easy and safe to cache for a long time (new packages will always have a newer version and therefore another URL).

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'apache2-ubuntu-mirror.conf'
2--- apache2-ubuntu-mirror.conf 1970-01-01 00:00:00 +0000
3+++ apache2-ubuntu-mirror.conf 2014-06-08 06:11:01 +0000
4@@ -0,0 +1,41 @@
5+# Example apache configuration for the ubuscript mirror.
6+# This will serve the default mirror directory on port 80 with a crude virtualhost.
7+# Don't forget to allow serving from /srv in /etc/apache2/apache2.conf, and
8+# to enable the "headers" module.
9+
10+<VirtualHost *:80>
11+ #ServerAdmin REPLACE_ME_WITH_ADMIN_EMAIL
12+ #ServerName REPLACE_ME_WITH_SERVER_NAME
13+
14+ DocumentRoot /srv/mirror
15+
16+ <Directory />
17+ Options Indexes FollowSymLinks MultiViews Includes
18+ AllowOverride None
19+ Order allow,deny
20+ allow from all
21+ </Directory>
22+
23+ # Set public cache control and a max age of 2 weeks for the debs.
24+ # New or different debs will have a different URL anyway since the version will change.
25+ <FilesMatch "\.(deb)$">
26+ Header set Cache-Control "max-age=1209600, public, must-revalidate"
27+ </FilesMatch>
28+
29+ # Don't cache HTML files as long (1 hour). This includes the indexes!
30+ # This makes caching much more agressive, but may result in updates
31+ # being delayed by this max-age value.
32+ #<FilesMatch "\.(html|torrent|gz|xz|bz|bz2|dsc|iso|gif|torrent)$">
33+ # Header set Cache-Control "max-age=3600, public, must-revalidate"
34+ #</FilesMatch>
35+
36+ ErrorLog /var/log/apache2/ubuntu-mirror_error.log
37+
38+ # Possible values include: debug, info, notice, warn, error, crit,
39+ # alert, emerg.
40+ LogLevel warn
41+
42+ CustomLog /var/log/apache2/ubuntu-mirror_access.log combined
43+ ServerSignature On
44+
45+</VirtualHost>
46
47=== modified file 'debian/ubumirror.examples'
48--- debian/ubumirror.examples 2010-01-23 16:35:07 +0000
49+++ debian/ubumirror.examples 2014-06-08 06:11:01 +0000
50@@ -1,1 +1,2 @@
51 ubumirror.crontab
52+apache2-ubuntu-mirror.conf

Subscribers

People subscribed via source and target branches

to status/vote changes: