Edgewall Software
Home
Trac
Trac Hacks
Genshi
Babel
Bitten
Home
Download
Documentation
Mailing Lists
License
FAQ
Search:
Login
Preferences
Help/Guide
About Trac
Wiki
Timeline
Roadmap
Browse Source
View Tickets
New Ticket
Search
Context Navigation
-1
Start Page
Index
History
Editing TracModWSGI
Adjust edit area height:
8
12
16
20
24
28
32
36
40
Edit side-by-side
= Trac and mod_wsgi = [http://code.google.com/p/modwsgi/ mod_wsgi] is an experimental Apache module for running WSGI-compatible Python applications directly on top of Apache: The mod_wsgi adapter is an Apache module that provides a WSGI compliant interface for hosting Python based web applications within Apache. The adapter is written completely in C code against the Apache C runtime and for hosting WSGI applications within Apache provides significantly better performance than using existing WSGI adapters for mod_python or CGI. It is already possible to run Trac on top of mod_wsgi. This can be done by writing the following application script. {{{ import os os.environ['TRAC_ENV'] = '/usr/local/trac/mysite' os.environ['PYTHON_EGG_CACHE'] = '/usr/local/trac/mysite/eggs' import trac.web.main application = trac.web.main.dispatch_request }}} The {{{TRAC_ENV}}} variable should naturally be the directory for your Trac environment (if you have several Trac environments in a directory, you can also use {{{TRAC_ENV_PARENT_DIR}}} instead), while the {{{PYTHON_EGG_CACHE}}} should be a directory where Python can temporarily extract Python eggs. For clarity, you should give this file a {{{.wsgi}}} extension. You should probably put the file in it's own directory, since you will open up it's directory to Apache. After you've done this, add the following to your httpd.conf. {{{ WSGIScriptAlias /trac /usr/local/trac/mysite/apache/mysite.wsgi <Directory /usr/local/trac/mysite/apache> Order deny,allow Allow from all </Directory> }}} Here, the script is in a subdirectory of the Trac environment. In order to let Apache run the script, access to the directory in which the script resides is opened up to all of Apache. Restart Apache, and then it should work. See also the mod_wsgi [http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac installation instructions] for Trac.
Note:
See
WikiFormatting
and
TracWiki
for help on editing wiki content.
Change information
Your email or username:
E-mail address and name can be saved in the
Preferences
Comment about this change (optional):
Note:
See
TracWiki
for help on using the wiki.