summaryrefslogtreecommitdiff
path: root/files/patchwork/apache.conf
blob: e797a57de2049ee67168b0f6c8a087a93389b2dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<VirtualHost *:80>
	ServerName {{hostname}}
	ErrorLog /var/log/apache2/{{hostname}}-error.log
	CustomLog /var/log/apache2/{{hostname}}-access.log combined

	DocumentRoot "{{install_base}}/{{hostname}}/project/htdocs"

	# Admin access should be always over SSL
	RewriteEngine On
	RewriteRule ^(/admin.*) https://{{hostname}}$1 [redirect=301,noescape,last]
	RewriteRule ^(/user/login.*) https://{{hostname}}$1 [redirect=301,noescape,last]

	Alias /static/ "{{install_base}}/{{hostname}}/static/"

        <Directory "{{install_base}}/{{hostname}}/static/">
		Order allow,deny
		Allow from all
		Require all granted
	</Directory>

	WSGIScriptAlias / "{{install_base}}/{{hostname}}/wsgi.py"
	<Directory "{{install_base}}/{{hostname}}">
		Require all granted
	</Directory>
</VirtualHost>

<VirtualHost *:443>
	ServerName {{hostname}}
	ErrorLog /var/log/apache2/{{hostname}}-error.log
	CustomLog /var/log/apache2/{{hostname}}-acess.log combined

	SSLEngine On
	SSLCertificateFile {{ssl_cert}}
	SSLCertificateKeyFile {{ssl_key}}
	SSLCACertificateFile {{ssl_ca_cert}}

	DocumentRoot "{{install_base}}/{{hostname}}/project/htdocs"

	Alias /static/ "{{install_base}}/{{hostname}}/static/"

        <Directory "{{install_base}}/{{hostname}}/static/">
		Order allow,deny
		Allow from all
		Require all granted
	</Directory>

	WSGIPassAuthorization On
	WSGIScriptAlias / "{{install_base}}/{{hostname}}/wsgi.py"
	<Directory "{{install_base}}/{{hostname}}">
		Require all granted
	</Directory>
</VirtualHost>