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-ssl.conf.in @ 1608:b8e5e9734526
History | View | Annotate | Download (4.3 KB)
| 1 |
|
|---|---|
| 2 |
# Apache config with SSL and admin auth stubbed in. You must provide |
| 3 |
# the key/cert and auth files. |
| 4 |
|
| 5 |
# Note this has been updated for Apache 2.4, which introduced a number |
| 6 |
# of (welcome) changes to access control directives. |
| 7 |
|
| 8 |
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 |
PassengerFriendlyErrorPages off |
| 20 |
RailsSpawnMethod smart |
| 21 |
ExpiresDefault "access plus 1 minute" |
| 22 |
|
| 23 |
# Redirect all activity to secure site |
| 24 |
Redirect seeother / "https://code.soundsoftware.ac.uk/" |
| 25 |
|
| 26 |
<DirectoryMatch "^/.*/\.svn/"> |
| 27 |
Require all denied |
| 28 |
</DirectoryMatch> |
| 29 |
|
| 30 |
<DirectoryMatch "^/.*/\.hg/"> |
| 31 |
Require all denied |
| 32 |
</DirectoryMatch> |
| 33 |
|
| 34 |
<DirectoryMatch "^/.*/\.git/"> |
| 35 |
Require all denied |
| 36 |
</DirectoryMatch> |
| 37 |
|
| 38 |
<Directory /var/www/code/public> |
| 39 |
Options -MultiViews |
| 40 |
</Directory> |
| 41 |
|
| 42 |
ErrorLog /var/log/apache2/code-error.log |
| 43 |
CustomLog /var/log/apache2/code-access.log vhost_combined |
| 44 |
|
| 45 |
LogLevel warn |
| 46 |
ServerSignature Off |
| 47 |
</VirtualHost> |
| 48 |
|
| 49 |
<VirtualHost *:443> |
| 50 |
ServerName code.soundsoftware.ac.uk |
| 51 |
ServerAdmin chris.cannam@soundsoftware.ac.uk |
| 52 |
|
| 53 |
SSLEngine on |
| 54 |
SSLCertificateFile /etc/apache2/certs/code.soundsoftware.ac.uk.crt |
| 55 |
SSLCertificateKeyFile /etc/apache2/certs/code.soundsoftware.ac.uk.key |
| 56 |
SSLCertificateChainFile /etc/apache2/certs/code.soundsoftware.ac.uk.ca-bundle |
| 57 |
SSLVerifyClient none |
| 58 |
SSLProtocol all -SSLv2 -SSLv3 |
| 59 |
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW |
| 60 |
|
| 61 |
DocumentRoot /var/www/code/public |
| 62 |
PassengerRestartDir restart_files |
| 63 |
PassengerHighPerformance on |
| 64 |
PassengerMaxRequests 50000 |
| 65 |
PassengerStatThrottleRate 5 |
| 66 |
PassengerStartTimeout 60 |
| 67 |
PassengerFriendlyErrorPages off |
| 68 |
RailsSpawnMethod smart |
| 69 |
ExpiresDefault "access plus 1 minute" |
| 70 |
|
| 71 |
<Location /sys> |
| 72 |
AuthType Basic |
| 73 |
AuthUserFile "/etc/apache2/auth/user.htpasswd" |
| 74 |
AuthName "code.soundsoftware.ac.uk" |
| 75 |
Require user user |
| 76 |
</Location> |
| 77 |
|
| 78 |
<Location /admin> |
| 79 |
AuthType Digest |
| 80 |
AuthUserFile "/etc/apache2/auth/admin.htdigest" |
| 81 |
AuthName "code.soundsoftware.ac.uk admin interface" |
| 82 |
Require user admin |
| 83 |
</Location> |
| 84 |
|
| 85 |
<DirectoryMatch "^/.*/\.svn/"> |
| 86 |
Require all denied |
| 87 |
</DirectoryMatch> |
| 88 |
|
| 89 |
<DirectoryMatch "^/.*/\.hg/"> |
| 90 |
Require all denied |
| 91 |
</DirectoryMatch> |
| 92 |
|
| 93 |
<DirectoryMatch "^/.*/\.git/"> |
| 94 |
Require all denied |
| 95 |
</DirectoryMatch> |
| 96 |
|
| 97 |
<Directory /var/www/code/public> |
| 98 |
Options -MultiViews |
| 99 |
</Directory> |
| 100 |
|
| 101 |
<Directory /var/www/code/public/themes/soundsoftware/stylesheets/fonts> |
| 102 |
# Avoid other sites embedding our fonts |
| 103 |
RewriteEngine on |
| 104 |
RewriteCond %{HTTP_REFERER} !^$
|
| 105 |
RewriteCond %{HTTP_REFERER} !^http(s)?://code.soundsoftware.ac.uk/.*$ [NC]
|
| 106 |
RewriteRule \.(ttf|woff|eot|otf|svg|zip|gz|html|txt)$ - [F] |
| 107 |
</Directory> |
| 108 |
|
| 109 |
ScriptAlias /hg "/var/hg/index.cgi" |
| 110 |
|
| 111 |
<Location /hg> |
| 112 |
AuthName "Mercurial" |
| 113 |
AuthType Basic |
| 114 |
Require valid-user |
| 115 |
PerlAccessHandler Apache::Authn::SoundSoftware::access_handler |
| 116 |
PerlAuthenHandler Apache::Authn::SoundSoftware::authen_handler |
| 117 |
PerlSetVar HTTPS "on" |
| 118 |
SoundSoftwareDSN "dbi:Pg:database=code;host=localhost" |
| 119 |
SoundSoftwareDbUser "code" |
| 120 |
SoundSoftwareDbPass "INSERT_DATABASE_PASSWORD_HERE" |
| 121 |
SoundSoftwareRepoPrefix "/var/hg/" |
| 122 |
SoundSoftwareSslRequired "on" |
| 123 |
Options +ExecCGI |
| 124 |
AddHandler cgi-script .cgi |
| 125 |
ExpiresDefault now |
| 126 |
</Location> |
| 127 |
|
| 128 |
Alias /git "/var/files/git-mirror" |
| 129 |
|
| 130 |
<Directory "/var/files/git-mirror"> |
| 131 |
Options -Indexes +FollowSymLinks |
| 132 |
Require all granted |
| 133 |
</Directory> |
| 134 |
<Directory ~ "/var/files/git-mirror/.*\.workdir"> |
| 135 |
Require all denied |
| 136 |
</Directory> |
| 137 |
<Directory ~ "/var/files/git-mirror/__.*"> |
| 138 |
Require all denied |
| 139 |
</Directory> |
| 140 |
|
| 141 |
ErrorLog /var/log/apache2/code-error.log |
| 142 |
CustomLog /var/log/apache2/code-access.log vhost_combined |
| 143 |
|
| 144 |
LogLevel warn |
| 145 |
ServerSignature Off |
| 146 |
|
| 147 |
</VirtualHost> |
| 148 |
|