To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / deploy / config / code.conf.in @ 1595:98384d0defa0

History | View | Annotate | Download (2.97 KB)

1

    
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
# 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
	PassengerStartTimeout 60
20
	PassengerFriendlyErrorPages on
21
        RailsSpawnMethod smart
22
        ExpiresDefault "access plus 1 minute"
23

    
24
#        <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
        <DirectoryMatch "^/.*/\.svn/">
39
                Require all denied
40
        </DirectoryMatch>
41

    
42
        <DirectoryMatch "^/.*/\.hg/">
43
                Require all denied
44
        </DirectoryMatch>
45

    
46
        <DirectoryMatch "^/.*/\.git/">
47
                Require all denied
48
        </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
		PerlSetVar HTTPS "on"
71
		SoundSoftwareDSN "dbi:Pg:database=code;host=localhost"
72
    		SoundSoftwareDbUser "code"
73
     		SoundSoftwareDbPass "INSERT_DATABASE_PASSWORD_HERE"
74
		SoundSoftwareRepoPrefix "/var/hg/"
75
                #!!! "on" in production please!:
76
                SoundSoftwareSslRequired "off"
77
		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
                Require all granted
87
	</Directory>
88
	<Directory ~ "/var/files/git-mirror/.*\.workdir">
89
                Require all denied
90
	</Directory>
91
	<Directory ~ "/var/files/git-mirror/__.*">
92
                Require all denied
93
	</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>
102