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
+0
Start Page
Index
History
Editing ApacheSuexec
Adjust edit area height:
8
12
16
20
24
28
32
36
40
Edit side-by-side
= Trac and Apache suEXEC = Trac in CGI-mode doesn't play very well with [http://httpd.apache.org/docs/suexec.html Apache suEXEC]. Setting the TRAC_ENV environment variable as described in TracInstall will not work when using suEXEC feature because the environment variables are filtered and only a limited subset reaches the CGI program. There are obvious workarounds to make things work: 1. Recompile suexec to let it pass the TRAC_ENV variable; which requires root permissions and is not really advisable anyway. 2. Change our trac.cgi script to set the TRAC_ENV variable by itself, to do this we edit trac.cgi file and add {{{ import os;os.environ['TRAC_ENV'] = '/path/to/projectenv' }}} at the very beginning of the script. 3. Make a wrapper script {{{ #!/bin/bash export TRAC_ENV='/path/to/projectenv' exec /path/to/trac/trac.cgi }}} '''Note: This is a kludge, but works.''' ---- == Multiple Projects under suEXEC == When hosting multiple projects under suEXEC, you can either copy the CGI script and change the TRAC_ENV setting for each script, or make a wrapper script around it. Here's a contributed script to work around the stripping of environment variables done by suEXEC. {{{ #!/bin/bash user="marcenuc" prj="${PATH_INFO#/}" prj="${prj%%/*}" export TRAC_ENV="/home/${user}/.trac/prj/${prj}" export SCRIPT_NAME="/~${user}/prj/${prj}" export PATH_INFO="${PATH_INFO#/${prj}}" export PYTHONPATH="/home/${user}/sw/lib/python2.3/site-packages" exec ./trac.cgi }}} ---- See also: TracInstall, TracMultipleProjects
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.