Chris@1570
|
1
|
Chris@1570
|
2 # A test Apache config. Lacks SSL, lacks a desirable extra layer of
|
Chris@1570
|
3 # authentication for admin interface paths. Do not deploy this.
|
Chris@1570
|
4
|
Chris@1570
|
5 PerlLoadModule Apache::Authn::SoundSoftware
|
Chris@1570
|
6
|
Chris@1570
|
7 <VirtualHost *:80>
|
Chris@1570
|
8 ServerName code.soundsoftware.ac.uk
|
Chris@1570
|
9 ServerAdmin chris.cannam@soundsoftware.ac.uk
|
Chris@1570
|
10
|
Chris@1570
|
11 DocumentRoot /var/www/code/public
|
Chris@1570
|
12 PassengerRestartDir restart_files
|
Chris@1570
|
13 PassengerHighPerformance on
|
Chris@1570
|
14 PassengerMaxRequests 50000
|
Chris@1570
|
15 PassengerStatThrottleRate 5
|
Chris@1570
|
16 PassengerStartTimeout 60
|
Chris@1571
|
17 PassengerFriendlyErrorPages on
|
Chris@1570
|
18 RailsSpawnMethod smart
|
Chris@1570
|
19 ExpiresDefault "access plus 1 minute"
|
Chris@1570
|
20
|
Chris@1570
|
21 <DirectoryMatch "^/.*/\.svn/">
|
Chris@1570
|
22 Order allow,deny
|
Chris@1570
|
23 Deny from all
|
Chris@1570
|
24 Satisfy All
|
Chris@1570
|
25 </DirectoryMatch>
|
Chris@1570
|
26
|
Chris@1570
|
27 <DirectoryMatch "^/.*/\.hg/">
|
Chris@1570
|
28 Order allow,deny
|
Chris@1570
|
29 Deny from all
|
Chris@1570
|
30 Satisfy All
|
Chris@1570
|
31 </DirectoryMatch>
|
Chris@1570
|
32
|
Chris@1570
|
33 <DirectoryMatch "^/.*/\.git/">
|
Chris@1570
|
34 Order allow,deny
|
Chris@1570
|
35 Deny from all
|
Chris@1570
|
36 Satisfy All
|
Chris@1570
|
37 </DirectoryMatch>
|
Chris@1570
|
38
|
Chris@1570
|
39 <Directory /var/www/code/public>
|
Chris@1570
|
40 Options -MultiViews
|
Chris@1570
|
41 </Directory>
|
Chris@1570
|
42
|
Chris@1570
|
43 <Directory /var/www/code/public/themes/soundsoftware/stylesheets/fonts>
|
Chris@1570
|
44 # Avoid other sites embedding our fonts
|
Chris@1570
|
45 RewriteEngine on
|
Chris@1570
|
46 RewriteCond %{HTTP_REFERER} !^$
|
Chris@1570
|
47 RewriteCond %{HTTP_REFERER} !^http(s)?://code.soundsoftware.ac.uk/.*$ [NC]
|
Chris@1570
|
48 RewriteRule \.(ttf|woff|eot|otf|svg|zip|gz|html|txt)$ - [F]
|
Chris@1570
|
49 </Directory>
|
Chris@1570
|
50
|
Chris@1570
|
51 ScriptAlias /hg "/var/hg/index.cgi"
|
Chris@1570
|
52
|
Chris@1570
|
53 <Location /hg>
|
Chris@1570
|
54 AuthName "Mercurial"
|
Chris@1570
|
55 AuthType Basic
|
Chris@1570
|
56 Require valid-user
|
Chris@1570
|
57 PerlAccessHandler Apache::Authn::SoundSoftware::access_handler
|
Chris@1570
|
58 PerlAuthenHandler Apache::Authn::SoundSoftware::authen_handler
|
Chris@1570
|
59 PerlSetVar HTTPS "on"
|
Chris@1570
|
60 SoundSoftwareDSN "dbi:Pg:database=code;host=localhost"
|
Chris@1570
|
61 SoundSoftwareDbUser "code"
|
Chris@1570
|
62 SoundSoftwareDbPass "INSERT_POSTGRES_PASSWORD_HERE"
|
Chris@1570
|
63 SoundSoftwareRepoPrefix "/var/hg/"
|
Chris@1576
|
64 #!!! "on" in production please!:
|
Chris@1576
|
65 SoundSoftwareSslRequired "off"
|
Chris@1570
|
66 Options +ExecCGI
|
Chris@1570
|
67 AddHandler cgi-script .cgi
|
Chris@1570
|
68 ExpiresDefault now
|
Chris@1570
|
69 </Location>
|
Chris@1570
|
70
|
Chris@1570
|
71 Alias /git "/var/files/git-mirror"
|
Chris@1570
|
72
|
Chris@1570
|
73 <Directory "/var/files/git-mirror">
|
Chris@1570
|
74 Options -Indexes +FollowSymLinks
|
Chris@1570
|
75 Order allow,deny
|
Chris@1570
|
76 Allow from all
|
Chris@1570
|
77 </Directory>
|
Chris@1570
|
78 <Directory ~ "/var/files/git-mirror/.*\.workdir">
|
Chris@1570
|
79 Order allow,deny
|
Chris@1570
|
80 Deny from all
|
Chris@1570
|
81 </Directory>
|
Chris@1570
|
82 <Directory ~ "/var/files/git-mirror/__.*">
|
Chris@1570
|
83 Order allow,deny
|
Chris@1570
|
84 Deny from all
|
Chris@1570
|
85 </Directory>
|
Chris@1570
|
86
|
Chris@1570
|
87 ErrorLog /var/log/apache2/code-error.log
|
Chris@1570
|
88 CustomLog /var/log/apache2/code-access.log vhost_combined
|
Chris@1570
|
89
|
Chris@1570
|
90 LogLevel warn
|
Chris@1570
|
91 ServerSignature Off
|
Chris@1570
|
92
|
Chris@1570
|
93 </VirtualHost>
|
Chris@1570
|
94
|