Skip to content

Commit dbda8e8

Browse files
committed
A WSGI connector for the datatracker, to let us run under mod_wsgi.
- Legacy-Id: 6157
1 parent 5033aba commit dbda8e8

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

ietf/wsgi.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"""
2+
WSGI configuration for the datatracker.
3+
4+
The following apache datatracker configuration has been used together with a
5+
datatracker checkout of trunk@ under /srv/www/ietfdb/ to run this on a development
6+
server using mod_wsgi under apache. For a production server, additional access
7+
restrictions are needed for the secretariat tools.
8+
9+
----
10+
# This directive must be set globally, not inside <Virtualhost/>:
11+
WSGIPythonEggs /var/www/.python-eggs/
12+
13+
<VirtualHost *:80>
14+
ServerName tracker.tools.ietf.org
15+
16+
DocumentRoot "/srv/www/ietfdb/static/"
17+
18+
AliasMatch "^/((robots.txt|favicon.ico|images|css|js|media)(.*))$" /srv/www/ietfdb/static/$1
19+
AliasMatch "^/secretariat/(img|css|js|error)(/|$)" /srv/www/ietfdb/static/secretariat/$1
20+
AliasMatch "^/secr/(img|css|js|error)(/|$)" /srv/www/ietfdb/static/secr/$1
21+
22+
WSGIScriptAlias / /srv/www/ietfdb/ietf/wsgi.py
23+
24+
<Location "/accounts/login">
25+
AuthType Digest
26+
AuthName "IETF"
27+
AuthUserFile /var/local/loginmgr/digest
28+
AuthGroupFile /var/local/loginmgr/groups
29+
AuthDigestDomain http://tools.ietf.org/
30+
Require valid-user
31+
</Location>
32+
33+
</VirtualHost>
34+
----
35+
36+
"""
37+
38+
39+
import os
40+
import sys
41+
import syslog
42+
43+
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
44+
if not path in sys.path:
45+
sys.path.insert(0, path)
46+
47+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ietf.settings")
48+
49+
import django.core.handlers.wsgi
50+
application = django.core.handlers.wsgi.WSGIHandler()
51+

0 commit comments

Comments
 (0)