To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / deploy / config / code.conf.in @ 1605:18643ab36008
History | View | Annotate | Download (2.97 KB)
| 1 | 1570:ae2f71010562 | Chris | |
|---|---|---|---|
| 2 | # A test Apache config. Lacks SSL, lacks a desirable extra layer of |
||
| 3 | # authentication for admin interface paths. Do not deploy this. |
||
| 4 | |||
| 5 | 1593:83412a0a2389 | Chris | # Note this has been updated for Apache 2.4, which introduced a number |
| 6 | # of (welcome) changes to access control directives. |
||
| 7 | |||
| 8 | 1570:ae2f71010562 | Chris | PerlLoadModule Apache::Authn::SoundSoftware |
| 9 | |||
| 10 | <VirtualHost *:80> |
||
| 11 | ServerName code.soundsoftware.ac.uk |
||
| 12 | ServerAdmin chris.cannam@soundsoftware.ac.uk |
||
| 13 | |||
| 14 | DocumentRoot /var/www/code/public |
||
| 15 | PassengerRestartDir restart_files |
||
| 16 | PassengerHighPerformance on |
||
| 17 | PassengerMaxRequests 50000 |
||
| 18 | PassengerStatThrottleRate 5 |
||
| 19 | PassengerStartTimeout 60 |
||
| 20 | 1571:4c2b25b7e85f | Chris | PassengerFriendlyErrorPages on |
| 21 | 1570:ae2f71010562 | Chris | RailsSpawnMethod smart |
| 22 | ExpiresDefault "access plus 1 minute" |
||
| 23 | |||
| 24 | 1590:c18460da6620 | Chris | # <Location /sys> |
| 25 | # AuthType Basic |
||
| 26 | # AuthUserFile "/etc/apache2/auth/user.htpasswd" |
||
| 27 | # AuthName "code.soundsoftware.ac.uk" |
||
| 28 | # Require user user |
||
| 29 | # </Location> |
||
| 30 | |||
| 31 | # <Location /admin> |
||
| 32 | # AuthType Digest |
||
| 33 | # AuthUserFile "/etc/apache2/auth/admin.htdigest" |
||
| 34 | # AuthName "code.soundsoftware.ac.uk admin interface" |
||
| 35 | # Require user admin |
||
| 36 | # </Location> |
||
| 37 | |||
| 38 | 1570:ae2f71010562 | Chris | <DirectoryMatch "^/.*/\.svn/"> |
| 39 | 1593:83412a0a2389 | Chris | Require all denied |
| 40 | 1570:ae2f71010562 | Chris | </DirectoryMatch> |
| 41 | |||
| 42 | <DirectoryMatch "^/.*/\.hg/"> |
||
| 43 | 1593:83412a0a2389 | Chris | Require all denied |
| 44 | 1570:ae2f71010562 | Chris | </DirectoryMatch> |
| 45 | |||
| 46 | <DirectoryMatch "^/.*/\.git/"> |
||
| 47 | 1593:83412a0a2389 | Chris | Require all denied |
| 48 | 1570:ae2f71010562 | Chris | </DirectoryMatch> |
| 49 | |||
| 50 | <Directory /var/www/code/public> |
||
| 51 | Options -MultiViews |
||
| 52 | </Directory> |
||
| 53 | |||
| 54 | <Directory /var/www/code/public/themes/soundsoftware/stylesheets/fonts> |
||
| 55 | # Avoid other sites embedding our fonts |
||
| 56 | RewriteEngine on |
||
| 57 | RewriteCond %{HTTP_REFERER} !^$
|
||
| 58 | RewriteCond %{HTTP_REFERER} !^http(s)?://code.soundsoftware.ac.uk/.*$ [NC]
|
||
| 59 | RewriteRule \.(ttf|woff|eot|otf|svg|zip|gz|html|txt)$ - [F] |
||
| 60 | </Directory> |
||
| 61 | |||
| 62 | ScriptAlias /hg "/var/hg/index.cgi" |
||
| 63 | |||
| 64 | <Location /hg> |
||
| 65 | AuthName "Mercurial" |
||
| 66 | AuthType Basic |
||
| 67 | Require valid-user |
||
| 68 | PerlAccessHandler Apache::Authn::SoundSoftware::access_handler |
||
| 69 | PerlAuthenHandler Apache::Authn::SoundSoftware::authen_handler |
||
| 70 | 1601:07deb8466f65 | Chris | PerlSetVar HTTPS "off" |
| 71 | 1570:ae2f71010562 | Chris | SoundSoftwareDSN "dbi:Pg:database=code;host=localhost" |
| 72 | SoundSoftwareDbUser "code" |
||
| 73 | 1593:83412a0a2389 | Chris | SoundSoftwareDbPass "INSERT_DATABASE_PASSWORD_HERE" |
| 74 | 1570:ae2f71010562 | Chris | SoundSoftwareRepoPrefix "/var/hg/" |
| 75 | 1576:d1de6986e429 | Chris | #!!! "on" in production please!: |
| 76 | SoundSoftwareSslRequired "off" |
||
| 77 | 1570:ae2f71010562 | Chris | Options +ExecCGI |
| 78 | AddHandler cgi-script .cgi |
||
| 79 | ExpiresDefault now |
||
| 80 | </Location> |
||
| 81 | |||
| 82 | Alias /git "/var/files/git-mirror" |
||
| 83 | |||
| 84 | <Directory "/var/files/git-mirror"> |
||
| 85 | Options -Indexes +FollowSymLinks |
||
| 86 | 1593:83412a0a2389 | Chris | Require all granted |
| 87 | 1570:ae2f71010562 | Chris | </Directory> |
| 88 | <Directory ~ "/var/files/git-mirror/.*\.workdir"> |
||
| 89 | 1593:83412a0a2389 | Chris | Require all denied |
| 90 | 1570:ae2f71010562 | Chris | </Directory> |
| 91 | <Directory ~ "/var/files/git-mirror/__.*"> |
||
| 92 | 1593:83412a0a2389 | Chris | Require all denied |
| 93 | 1570:ae2f71010562 | Chris | </Directory> |
| 94 | |||
| 95 | ErrorLog /var/log/apache2/code-error.log |
||
| 96 | CustomLog /var/log/apache2/code-access.log vhost_combined |
||
| 97 | |||
| 98 | LogLevel warn |
||
| 99 | ServerSignature Off |
||
| 100 | |||
| 101 | </VirtualHost> |