шаблон vhost для развертки django приложения

 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
AddHandler wsgi-script .wsgi
AddHandler fastcgi-script .fcgi
<VirtualHost *>
ServerName %PROJECT%.%ZONE%
ServerAdmin %EMAIL%
DocumentRoot "%WWWDIR%/%PROJECT%/htdocs"
CustomLog "%WWWDIR%/%PROJECT%/logs/access.log" common
ErrorLog "%WWWDIR%/%PROJECT%/logs/error.log"
LogLevel debug
%TRAC% WSGIScriptAlias "/trac" "%WWWDIR%/%PROJECT%/htdocs/trac.wsgi"
WSGIScriptAlias "/" "%WWWDIR%/%PROJECT%/htdocs/index.wsgi"
<Directory "%WWWDIR%/%PROJECT%/htdocs">
DirectoryIndex index.html
AllowOverride None
Options +ExecCGI +FollowSymLinks +Indexes
Order allow,deny
Allow from All
</Directory>
Alias "/media/" "%PROJECTDIR%/media/"
Alias "/admin/media/" "%DJANGO%/contrib/admin/media/"
<Directory "%PROJECTDIR%/media/">
SetHandler None
Options -Indexes +FollowSymLinks -ExecCGI
AllowOverride None
Order allow,deny
Allow from All
</Directory>
<Directory "%DJANGO%/contrib/admin/media/">
SetHandler None
Options -Indexes +FollowSymLinks -ExecCGI
AllowOverride None
Order allow,deny
Allow from All
</Directory>
%TRAC% <Location "/trac/login">
%TRAC% AuthType Basic
%TRAC% AuthName "Trac"
%TRAC% AuthUserFile /etc/apache2/trac.htpasswd
%TRAC% Require valid-user
%TRAC% </Location>
</VirtualHost>
# vim: ts=4 filetype=apache