<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to TracModPython</title><link>https://sourceforge.net/p/deepmethod/wiki/TracModPython/</link><description>Recent changes to TracModPython</description><atom:link href="https://sourceforge.net/p/deepmethod/wiki/TracModPython/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 11 Feb 2015 12:39:49 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/deepmethod/wiki/TracModPython/feed" rel="self" type="application/rss+xml"/><item><title>TracModPython modified by KKozlov</title><link>https://sourceforge.net/p/deepmethod/wiki/TracModPython/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;a class="" href="../TracModPython?action=diff&amp;amp;version=1"&gt;Last modified&lt;/a&gt; &lt;a class="" href="/trac/DEEP/timeline?from=2012-08-22T09%3A39%3A22%2B04%3A00&amp;amp;precision=second"&gt;2 years&lt;/a&gt; ago&lt;/p&gt;
&lt;h1 id="trac-and-mod_python"&gt;Trac and mod_python&lt;/h1&gt;
&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#trac-and-mod_python"&gt;Trac and mod_python&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#a-word-of-warning"&gt;A Word of Warning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#simple-configuration"&gt;Simple configuration&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#python-egg-cache"&gt;Python Egg Cache&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#configuring-authentication"&gt;Configuring Authentication&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#setting-the-python-egg-cache"&gt;Setting the Python Egg Cache&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#setting-the-pythonpath"&gt;Setting the PythonPath&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#setting-up-multiple-projects"&gt;Setting up multiple projects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#virtual-host-configuration"&gt;Virtual Host Configuration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#troubleshooting"&gt;Troubleshooting&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#expat-related-segmentation-faults"&gt;Expat-related segmentation faults&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#form-submission-problems"&gt;Form submission problems&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#problem-with-virtual-host-configuration"&gt;Problem with virtual host configuration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#problem-with-zipped-egg"&gt;Problem with zipped egg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#using-htaccess"&gt;Using .htaccess&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#additional-htaccess-help"&gt;Additional .htaccess help&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#win32-issues"&gt;Win32 Issues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#os-x-issues"&gt;OS X issues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#selinux-issues"&gt;SELinux issues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#freebsd-issues"&gt;FreeBSD issues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#subversion-issues"&gt;Subversion issues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#page-layout-issues"&gt;Page layout issues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#https-issues"&gt;HTTPS issues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#fedora-7-issues"&gt;Fedora 7 Issues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#segmentation-fault-with-php5-mhash-or-other-php5-modules"&gt;Segmentation fault with php5-mhash or other php5 modules&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;p&gt;Trac supports &lt;a class="" href="http://www.modpython.org" rel="nofollow"&gt; mod_python&lt;/a&gt;, which speeds up Trac's response times considerably, especially compared to &lt;a class="" href="/p/deepmethod/wiki/TracCgi"&gt;CGI&lt;/a&gt;, and permits use of many Apache features not possible with &lt;a class="" href="/p/deepmethod/wiki/TracStandalone"&gt;tracd&lt;/a&gt;/mod_proxy. &lt;/p&gt;
&lt;p&gt;These instructions are for Apache 2; if you are still using Apache 1.3, you may have some luck with &lt;a class="" href="http://trac.edgewall.org/intertrac/wiki%3ATracModPython2.7" rel="nofollow"&gt; TracModPython2.7&lt;/a&gt;. &lt;/p&gt;
&lt;h2 id="a-word-of-warning"&gt;A Word of Warning&lt;/h2&gt;
&lt;p&gt;As of 16th June 2010, the mod_python project is officially dead. If you are considering using mod_python for a new installation, &lt;strong&gt;please don't&lt;/strong&gt;! There are known issues which will not be fixed and there are now better alternatives. Check out the main &lt;a class="alink" href="/p/deepmethod/wiki/TracInstall"&gt;[TracInstall]&lt;/a&gt; pages for your target version for more information. &lt;/p&gt;
&lt;h2 id="simple-configuration"&gt;Simple configuration&lt;/h2&gt;
&lt;p&gt;If you just installed mod_python, you may have to add a line to load the module in the Apache configuration: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;LoadModule&lt;/span&gt; &lt;span class="n"&gt;python_module&lt;/span&gt; &lt;span class="n"&gt;modules&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mod_python&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;so&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Note: The exact path to the module depends on how the HTTPD installation is laid out.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;On Debian using apt-get &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;apt&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;libapache2&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="n"&gt;libapache2&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;mod&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;(Still on Debian) after you have installed mod_python, you must enable the modules in apache2 (equivalent of the above Load Module directive): &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;a2enmod&lt;/span&gt; &lt;span class="n"&gt;python&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;On Fedora use, using yum: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;yum&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;mod_python&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can test your mod_python installation by adding the following to your httpd.conf. You should remove this when you are done testing for security reasons. Note: mod_python.testhandler is only available in mod_python 3.2+. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/mpinfo&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   SetHandler mod_python
   PythonInterpreter main_interpreter
   PythonHandler mod_python.testhandler
&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A simple setup of Trac on mod_python looks like this: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/projects/myproject&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   SetHandler mod_python
   PythonInterpreter main_interpreter
   PythonHandler trac.web.modpython_frontend 
   PythonOption TracEnv /var/trac/myproject
   PythonOption TracUriRoot /projects/myproject
&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The option &lt;strong&gt;&lt;code&gt;TracUriRoot&lt;/code&gt;&lt;/strong&gt; may or may not be necessary in your setup. Try your configuration without it; if the URLs produced by Trac look wrong, if Trac does not seem to recognize URLs correctly, or you get an odd "No handler matched request to..." error, add the &lt;strong&gt;&lt;code&gt;TracUriRoot&lt;/code&gt;&lt;/strong&gt; option. You will notice that the &lt;code&gt;Location&lt;/code&gt; and &lt;strong&gt;&lt;code&gt;TracUriRoot&lt;/code&gt;&lt;/strong&gt; have the same path. &lt;/p&gt;
&lt;p&gt;The options available are &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;    &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="n"&gt;For&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;single&lt;/span&gt; &lt;span class="n"&gt;project&lt;/span&gt;
    &lt;span class="n"&gt;PythonOption&lt;/span&gt; &lt;span class="n"&gt;TracEnv&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;trac&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;myproject&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="n"&gt;For&lt;/span&gt; &lt;span class="n"&gt;multiple&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt;
    &lt;span class="n"&gt;PythonOption&lt;/span&gt; &lt;span class="n"&gt;TracEnvParentDir&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;trac&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;myprojects&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="n"&gt;For&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;multiple&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt;
    &lt;span class="n"&gt;PythonOption&lt;/span&gt; &lt;span class="n"&gt;TracEnvIndexTemplate&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;srv&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;www&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;htdocs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;trac&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;project_list_template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="n"&gt;space&lt;/span&gt; &lt;span class="n"&gt;delimitted&lt;/span&gt; &lt;span class="n"&gt;list&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="s"&gt;","&lt;/span&gt; &lt;span class="n"&gt;between&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="n"&gt;pairs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
    &lt;span class="n"&gt;PythonOption&lt;/span&gt; &lt;span class="n"&gt;TracTemplateVars&lt;/span&gt; &lt;span class="n"&gt;key1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;val1&lt;/span&gt; &lt;span class="n"&gt;key2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;val2&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="n"&gt;Useful&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;wanted&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt;
    &lt;span class="n"&gt;PythonOption&lt;/span&gt; &lt;span class="n"&gt;TracLocale&lt;/span&gt; &lt;span class="n"&gt;en_GB&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;UTF8&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="n"&gt;See&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="n"&gt;above&lt;/span&gt;        
    &lt;span class="n"&gt;PythonOption&lt;/span&gt; &lt;span class="n"&gt;TracUriRoot&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;projects&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;myproject&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id="python-egg-cache"&gt;Python Egg Cache&lt;/h3&gt;
&lt;p&gt;Compressed python eggs like Genshi are normally extracted into a directory named &lt;code&gt;.python-eggs&lt;/code&gt; in the users home directory. Since apache's home usually is not writable an alternate egg cache directory can be specified like this: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;PythonOption&lt;/span&gt; &lt;span class="n"&gt;PYTHON_EGG_CACHE&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;trac&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;myprojects&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;egg&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or you can uncompress the Genshi egg to resolve problems extracting from it. &lt;/p&gt;
&lt;h3 id="configuring-authentication"&gt;Configuring Authentication&lt;/h3&gt;
&lt;p&gt;Creating password files and configuring authentication works similar to the process for &lt;a class="" href="../TracCgi#AddingAuthentication"&gt;CGI&lt;/a&gt;: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/projects/myproject/login&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  AuthType Basic
  AuthName "myproject"
  AuthUserFile /var/trac/myproject/.htpasswd
  Require valid-user
&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Configuration for mod_ldap authentication in Apache is a bit tricky (httpd 2.2.x and OpenLDAP: slapd 2.3.19) &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You need to load the following modules in Apache httpd.conf &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;LoadModule&lt;/span&gt; &lt;span class="n"&gt;ldap_module&lt;/span&gt; &lt;span class="n"&gt;modules&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mod_ldap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;so&lt;/span&gt;
&lt;span class="n"&gt;LoadModule&lt;/span&gt; &lt;span class="n"&gt;authnz_ldap_module&lt;/span&gt; &lt;span class="n"&gt;modules&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mod_authnz_ldap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;so&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Your httpd.conf also needs to look something like: &lt;/p&gt;
&lt;p&gt;&amp;lt;Location trac=""/&amp;gt;&lt;br /&gt;
  SetHandler mod_python&lt;br /&gt;
  PythonInterpreter main_interpreter&lt;br /&gt;
  PythonHandler trac.web.modpython_frontend&lt;br /&gt;
  PythonOption TracEnv /home/trac/&lt;br /&gt;
  PythonOption TracUriRoot /trac/&lt;br /&gt;
  Order deny,allow&lt;br /&gt;
  Deny from all&lt;br /&gt;
  Allow from 192.168.11.0/24&lt;br /&gt;
  AuthType Basic&lt;br /&gt;
  AuthName "Trac"&lt;br /&gt;
  AuthBasicProvider "ldap"&lt;br /&gt;
  AuthLDAPURL "ldap://127.0.0.1/dc=example,dc=co,dc=ke?uid?sub?(objectClass=inetOrgPerson)"&lt;br /&gt;
  authzldapauthoritative Off&lt;br /&gt;
  require valid-user&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Or the LDAP interface to a Microsoft Active Directory: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/trac&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  SetHandler mod_python
  PythonInterpreter main_interpreter
  PythonHandler trac.web.modpython_frontend
  PythonOption TracEnv /home/trac/
  PythonOption TracUriRoot /trac/
  Order deny,allow
  Deny from all
  Allow from 192.168.11.0/24
  AuthType Basic
  AuthName "Trac"
  AuthBasicProvider "ldap"
  AuthLDAPURL "ldap://adserver.company.com:3268/DC=company,DC=com?sAMAccountName?sub?(objectClass=user)"
  AuthLDAPBindDN       ldap-auth-user@company.com
  AuthLDAPBindPassword "the_password"
  authzldapauthoritative Off
  # require valid-user
  require ldap-group CN=Trac Users,CN=Users,DC=company,DC=com
&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note 1: This is the case where the LDAP search will get around the multiple OUs, conecting to Global Catalog Server portion of AD (Notice the port is 3268, not the normal LDAP 389). The GCS is basically a "flattened" tree which allows searching for a user without knowing to which OU they belong. &lt;/p&gt;
&lt;p&gt;Note 2: Active Directory requires an authenticating user/password to access records (AuthLDAPBindDN and AuthLDAPBindPassword). &lt;/p&gt;
&lt;p&gt;Note 3: The directive "require ldap-group ..." specifies an AD group whose members are allowed access. &lt;/p&gt;
&lt;h3 id="setting-the-python-egg-cache"&gt;Setting the Python Egg Cache&lt;/h3&gt;
&lt;p&gt;If the Egg Cache isn't writeable by your Web server, you'll either have to change the permissions, or point Python to a location where Apache can write. This can manifest itself as a &lt;em&gt;500 internal server error&lt;/em&gt; and/or a complaint in the syslog. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/projects/myproject&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  ...
  PythonOption PYTHON_EGG_CACHE /tmp 
  ...
&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id="setting-the-pythonpath"&gt;Setting the PythonPath&lt;/h3&gt;
&lt;p&gt;If the Trac installation isn't installed in your Python path, you'll have to tell Apache where to find the Trac mod_python handler using the &lt;code&gt;PythonPath&lt;/code&gt; directive: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/projects/myproject&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  ...
  PythonPath "sys.path + &lt;span class="cp"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'/path/to/trac'&lt;/span&gt;&lt;span class="cp"&gt;]&lt;/span&gt;"
  ...
&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Be careful about using the PythonPath directive, and &lt;em&gt;not&lt;/em&gt; &lt;code&gt;SetEnv PYTHONPATH&lt;/code&gt;, as the latter won't work. &lt;/p&gt;
&lt;h2 id="setting-up-multiple-projects"&gt;Setting up multiple projects&lt;/h2&gt;
&lt;p&gt;The Trac mod_python handler supports a configuration option similar to Subversion's &lt;code&gt;SvnParentPath&lt;/code&gt;, called &lt;code&gt;TracEnvParentDir&lt;/code&gt;: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/projects&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  SetHandler mod_python
  PythonInterpreter main_interpreter
  PythonHandler trac.web.modpython_frontend 
  PythonOption TracEnvParentDir /var/trac
  PythonOption TracUriRoot /projects
&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When you request the &lt;code&gt;/projects&lt;/code&gt; URL, you will get a listing of all subdirectories of the directory you set as &lt;code&gt;TracEnvParentDir&lt;/code&gt; that look like Trac environment directories. Selecting any project in the list will bring you to the corresponding Trac environment. &lt;/p&gt;
&lt;p&gt;If you don't want to have the subdirectory listing as your projects home page you can use a &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;LocationMatch&lt;/span&gt; &lt;span class="s"&gt;"/.+/"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will instruct Apache to use mod_python for all locations different from root while having the possibility of placing a custom home page for root in your DocumentRoot folder. &lt;/p&gt;
&lt;p&gt;You can also use the same authentication realm for all of the projects using a &lt;code&gt;&amp;lt;LocationMatch&amp;gt;&lt;/code&gt; directive: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;LocationMatch&lt;/span&gt; &lt;span class="err"&gt;"/projects/&lt;/span&gt;&lt;span class="cp"&gt;[&lt;/span&gt;&lt;span class="p"&gt;^&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="cp"&gt;]&lt;/span&gt;&lt;span class="err"&gt;+/login"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  AuthType Basic
  AuthName "Trac"
  AuthUserFile /var/trac/.htpasswd
  Require valid-user
&lt;span class="nt"&gt;&amp;lt;/LocationMatch&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="virtual-host-configuration"&gt;Virtual Host Configuration&lt;/h2&gt;
&lt;p&gt;Below is the sample configuration required to set up your trac as a virtual server (i.e. when you access it at the URLs like &lt;a href="http://trac.mycompany.com" rel="nofollow"&gt;http://trac.mycompany.com&lt;/a&gt;): &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;VirtualHost&lt;/span&gt; &lt;span class="err"&gt;*&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    DocumentRoot /var/www/myproject
    ServerName trac.mycompany.com
    &lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        SetHandler mod_python
        PythonInterpreter main_interpreter
        PythonHandler trac.web.modpython_frontend
        PythonOption TracEnv /var/trac/myproject
        PythonOption TracUriRoot /
    &lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/login&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        AuthType Basic
        AuthName "MyCompany Trac Server"
        AuthUserFile /var/trac/myproject/.htpasswd
        Require valid-user
    &lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/VirtualHost&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This does not seem to work in all cases. What you can do if it does not: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Try using &lt;code&gt;&amp;lt;LocationMatch&amp;gt;&lt;/code&gt; instead of &lt;code&gt;&amp;lt;Location&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;Location /&amp;gt; may, in your server setup, refer to the complete host instead of simple the root of the server. This means that everything (including the login directory referenced below) will be sent to python and authentication does not work (i.e. you get the infamous Authentication information missing error). If this applies to you, try using a sub-directory for trac instead of the root (i.e. /web/ and /web/login instead of / and /login). &lt;/li&gt;
&lt;li&gt;Depending on apache's &lt;code&gt;NameVirtualHost&lt;/code&gt; configuration, you may need to use &lt;code&gt;&amp;lt;VirtualHost *:80&amp;gt;&lt;/code&gt; instead of &lt;code&gt;&amp;lt;VirtualHost *&amp;gt;&lt;/code&gt;. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a virtual host that supports multiple projects replace "&lt;code&gt;TracEnv&lt;/code&gt;" /var/trac/myproject with "&lt;code&gt;TracEnvParentDir&lt;/code&gt;" /var/trac/ &lt;/p&gt;
&lt;p&gt;Note: DocumentRoot should not point to your Trac project env. As Asmodai wrote on #trac: "suppose there's a webserver bug that allows disclosure of DocumentRoot they could then leech the entire Trac environment". &lt;/p&gt;
&lt;h2 id="troubleshooting"&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;In general, if you get server error pages, you can either check the Apache error log, or enable the &lt;code&gt;PythonDebug&lt;/code&gt; option: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/projects/myproject&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  ...
  PythonDebug on
&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;For multiple projects, try restarting the server as well. &lt;/p&gt;
&lt;h3 id="expat-related-segmentation-faults"&gt;Expat-related segmentation faults&lt;/h3&gt;
&lt;p&gt;This problem will most certainly hit you on Unix when using Python 2.4. In Python 2.4, some version of Expat (an XML parser library written in C) is used, and if Apache is using another version, this results in segmentation faults. As Trac 0.11 is using Genshi, which will indirectly use Expat, that problem can now hit you even if everything was working fine before with Trac 0.10. &lt;/p&gt;
&lt;p&gt;See Graham Dumpleton's detailed &lt;a class="" href="http://www.dscpl.com.au/wiki/ModPython/Articles/ExpatCausingApacheCrash" rel="nofollow"&gt; explanation and workarounds&lt;/a&gt; for the issue. &lt;/p&gt;
&lt;h3 id="form-submission-problems"&gt;Form submission problems&lt;/h3&gt;
&lt;p&gt;If you're experiencing problems submitting some of the forms in Trac (a common problem is that you get redirected to the start page after submission), check whether your &lt;code&gt;DocumentRoot&lt;/code&gt; contains a folder or file with the same path that you mapped the mod_python handler to. For some reason, mod_python gets confused when it is mapped to a location that also matches a static resource. &lt;/p&gt;
&lt;h3 id="problem-with-virtual-host-configuration"&gt;Problem with virtual host configuration&lt;/h3&gt;
&lt;p&gt;If the &amp;lt;Location /&amp;gt; directive is used, setting the &lt;code&gt;DocumentRoot&lt;/code&gt; may result in a &lt;em&gt;403 (Forbidden)&lt;/em&gt; error. Either remove the &lt;code&gt;DocumentRoot&lt;/code&gt; directive, or make sure that accessing the directory it points is allowed (in a corresponding &lt;code&gt;&amp;lt;Directory&amp;gt;&lt;/code&gt; block). &lt;/p&gt;
&lt;p&gt;Using &amp;lt;Location /&amp;gt; together with &lt;code&gt;SetHandler&lt;/code&gt; resulted in having everything handled by mod_python, which leads to not being able download any CSS or images/icons. I used &amp;lt;Location /trac&amp;gt; &lt;code&gt;SetHandler None&lt;/code&gt; &amp;lt;/Location&amp;gt; to circumvent the problem, though I do not know if this is the most elegant solution. &lt;/p&gt;
&lt;h3 id="problem-with-zipped-egg"&gt;Problem with zipped egg&lt;/h3&gt;
&lt;p&gt;It's possible that your version of mod_python will not import modules from zipped eggs. If you encounter an &lt;code&gt;ImportError: No module named trac&lt;/code&gt; in your Apache logs but you think everything is where it should be, this might be your problem. Look in your site-packages directory; if the Trac module appears as a &lt;em&gt;file&lt;/em&gt; rather than a &lt;em&gt;directory&lt;/em&gt;, then this might be your problem. To rectify, try installing Trac using the &lt;code&gt;--always-unzip&lt;/code&gt; option, like this: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;easy_install&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;unzip&lt;/span&gt; &lt;span class="n"&gt;Trac&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.12&lt;/span&gt;&lt;span class="n"&gt;b1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zip&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id="using-htaccess"&gt;Using .htaccess&lt;/h3&gt;
&lt;p&gt;Although it may seem trivial to rewrite the above configuration as a directory in your document root with a &lt;code&gt;.htaccess&lt;/code&gt; file, this does not work. Apache will append a "/" to any Trac URLs, which interferes with its correct operation. &lt;/p&gt;
&lt;p&gt;It may be possible to work around this with mod_rewrite, but I failed to get this working. In all, it is more hassle than it is worth. Stick to the provided instructions. :) &lt;/p&gt;
&lt;p&gt;A success story: For me it worked out-of-box, with following trivial config: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;SetHandler&lt;/span&gt; &lt;span class="n"&gt;mod_python&lt;/span&gt;
&lt;span class="n"&gt;PythonInterpreter&lt;/span&gt; &lt;span class="n"&gt;main_interpreter&lt;/span&gt;
&lt;span class="n"&gt;PythonHandler&lt;/span&gt; &lt;span class="n"&gt;trac&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;web&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;modpython_frontend&lt;/span&gt; 
&lt;span class="n"&gt;PythonOption&lt;/span&gt; &lt;span class="n"&gt;TracEnv&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;this&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;directory&lt;/span&gt;
&lt;span class="n"&gt;PythonOption&lt;/span&gt; &lt;span class="n"&gt;TracUriRoot&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;apache&lt;/span&gt;

&lt;span class="n"&gt;AuthType&lt;/span&gt; &lt;span class="n"&gt;Basic&lt;/span&gt;
&lt;span class="n"&gt;AuthName&lt;/span&gt; &lt;span class="s"&gt;"ProjectName"&lt;/span&gt;
&lt;span class="n"&gt;AuthUserFile&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;htpasswd&lt;/span&gt;
&lt;span class="n"&gt;Require&lt;/span&gt; &lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;TracUriRoot&lt;/code&gt; is obviously the path you need to enter to the browser to get to the trac (e.g. domain.tld/projects/trac) &lt;/p&gt;
&lt;h3 id="additional-htaccess-help"&gt;Additional .htaccess help&lt;/h3&gt;
&lt;p&gt;If you are using the .htaccess method you may have additional problems if your trac directory is inheriting .htaccess directives from another. This may also help to add to your .htaccess file: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;IfModule&lt;/span&gt; &lt;span class="err"&gt;mod_rewrite.c&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  RewriteEngine Off
&lt;span class="nt"&gt;&amp;lt;/IfModule&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id="win32-issues"&gt;Win32 Issues&lt;/h3&gt;
&lt;p&gt;If you run trac with mod_python &amp;lt; 3.2 on Windows, uploading attachments will &lt;strong&gt;not&lt;/strong&gt; work. This problem is resolved in mod_python 3.1.4 or later, so please upgrade mod_python to fix this. &lt;/p&gt;
&lt;h3 id="os-x-issues"&gt;OS X issues&lt;/h3&gt;
&lt;p&gt;When using mod_python on OS X you will not be able to restart Apache using &lt;code&gt;apachectl restart&lt;/code&gt;. This is apparently fixed in mod_python 3.2, but there's also a patch available for earlier versions &lt;a class="" href="http://www.dscpl.com.au/projects/vampire/patches.html" rel="nofollow"&gt; here&lt;/a&gt;. &lt;/p&gt;
&lt;h3 id="selinux-issues"&gt;SELinux issues&lt;/h3&gt;
&lt;p&gt;If Trac reports something like: &lt;em&gt;Cannot get shared lock on db.lock&lt;/em&gt; The security context on the repository may need to be set: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;chcon&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="kt"&gt;httpd_sys_content_t&lt;/span&gt; &lt;span class="n"&gt;PATH_TO_REPOSITORY&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;See also &lt;a class="" href="http://subversion.tigris.org/faq.html#reposperms" rel="nofollow"&gt; &lt;/a&gt;&lt;a href="http://subversion.tigris.org/faq.html#reposperms" rel="nofollow"&gt;&lt;/a&gt;&lt;a href="http://subversion.tigris.org/faq.html#reposperms" rel="nofollow"&gt;http://subversion.tigris.org/faq.html#reposperms&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="freebsd-issues"&gt;FreeBSD issues&lt;/h3&gt;
&lt;p&gt;Pay attention to the version of the installed mod_python and sqlite packages. Ports have both the new and old ones, but earlier versions of pysqlite and mod_python won't integrate as the former requires threaded support in python, and the latter requires a threadless install. &lt;/p&gt;
&lt;p&gt;If you compiled and installed apache2, apache wouldn´t support threads (cause it doesn´t work very well on FreeBSD). You could force thread support when running ./configure for apache, using --enable-threads, but this isn´t recommendable. The best option &lt;a class="" href="http://modpython.org/pipermail/mod_python/2006-September/021983.html" rel="nofollow"&gt; seems to be&lt;/a&gt; adding to /usr/local/apache2/bin/ennvars the line &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;export&lt;/span&gt; &lt;span class="n"&gt;LD_PRELOAD&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;libc_r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;so&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id="subversion-issues"&gt;Subversion issues&lt;/h3&gt;
&lt;p&gt;If you get the following Trac Error &lt;code&gt;Unsupported version control system "svn"&lt;/code&gt; only under mod_python, though it works well on the command-line and even with &lt;a class="alink" href="/p/deepmethod/wiki/TracStandalone"&gt;[TracStandalone]&lt;/a&gt;, chances are that you forgot to add the path to the Python bindings with the &lt;a class="" href="../TracModPython#ConfiguringPythonPath"&gt;PythonPath&lt;/a&gt; directive. (The better way is to add a link to the bindings in the Python &lt;code&gt;site-packages&lt;/code&gt; directory, or create a &lt;code&gt;.pth&lt;/code&gt; file in that directory.) &lt;/p&gt;
&lt;p&gt;If this is not the case, it's possible that you're using Subversion libraries that are binary incompatible with the apache ones (an incompatibility of the &lt;code&gt;apr&lt;/code&gt; libraries is usually the cause). In that case, you also won't be able to use the svn modules for Apache (&lt;code&gt;mod_dav_svn&lt;/code&gt;). &lt;/p&gt;
&lt;p&gt;You also need a recent version of &lt;code&gt;mod_python&lt;/code&gt; in order to avoid a runtime error (&lt;code&gt;argument number 2: a 'apr_pool_t *' is expected&lt;/code&gt;) due to the default usage of multiple sub-interpreters. 3.2.8 &lt;em&gt;should&lt;/em&gt; work, though it's probably better to use the workaround described in &lt;a class="" href="http://trac.edgewall.org/intertrac/%233371" rel="nofollow"&gt; #3371&lt;/a&gt;, in order to force the use of the main interpreter: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;PythonInterpreter&lt;/span&gt; &lt;span class="n"&gt;main_interpreter&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is anyway the recommended workaround for other well-known issues seen when using the Python bindings for Subversion within mod_python (&lt;a class="" href="http://trac.edgewall.org/intertrac/%232611" rel="nofollow"&gt; #2611&lt;/a&gt;, &lt;a class="" href="http://trac.edgewall.org/intertrac/%233455" rel="nofollow"&gt; #3455&lt;/a&gt;). See in particular Graham Dumpleton's comment in &lt;a class="" href="http://trac.edgewall.org/intertrac/comment%3A9%3Aticket%3A3455" rel="nofollow"&gt; #3455&lt;/a&gt; explaining the issue. &lt;/p&gt;
&lt;h3 id="page-layout-issues"&gt;Page layout issues&lt;/h3&gt;
&lt;p&gt;If the formatting of the Trac pages look weird chances are that the style sheets governing the page layout are not handled properly by the web server. Try adding the following lines to your apache configuration: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nx"&gt;Alias&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;myproject&lt;/span&gt;&lt;span class="p"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;css&lt;/span&gt; &lt;span class="s2"&gt;"/usr/share/trac/htdocs/css"&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Location&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;myproject&lt;/span&gt;&lt;span class="p"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;css&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;SetHandler&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;Location&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note: For the above configuration to have any effect it must be put after the configuration of your project root location, i.e. &lt;code&gt;&amp;lt;Location /myproject /&amp;gt;&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;Also, setting &lt;code&gt;PythonOptimize On&lt;/code&gt; seems to mess up the page headers and footers, in addition to hiding the documentation for macros and plugins (see #Trac8956). Considering how little effect the option has, it is probably a good idea to leave it &lt;code&gt;Off&lt;/code&gt;. &lt;/p&gt;
&lt;h3 id="https-issues"&gt;HTTPS issues&lt;/h3&gt;
&lt;p&gt;If you want to run Trac fully under https you might find that it tries to redirect to plain http. In this case just add the following line to your apache configuration: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;VirtualHost&lt;/span&gt; &lt;span class="err"&gt;*&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    DocumentRoot /var/www/myproject
    ServerName trac.mycompany.com
    SetEnv HTTPS 1
    ....
&lt;span class="nt"&gt;&amp;lt;/VirtualHost&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id="fedora-7-issues"&gt;Fedora 7 Issues&lt;/h3&gt;
&lt;p&gt;Make sure you install the 'python-sqlite2' package as it seems to be required for &lt;a class="alink" href="/p/deepmethod/wiki/TracModPython"&gt;[TracModPython]&lt;/a&gt; but not for tracd &lt;/p&gt;
&lt;h3 id="segmentation-fault-with-php5-mhash-or-other-php5-modules"&gt;Segmentation fault with php5-mhash or other php5 modules&lt;/h3&gt;
&lt;p&gt;You may encounter segfaults (reported on debian etch) if php5-mhash module is installed. Try to remove it to see if this solves the problem. See debian bug report &lt;a class="" href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411487" rel="nofollow"&gt; &lt;/a&gt;&lt;a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411487" rel="nofollow"&gt;&lt;/a&gt;&lt;a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411487" rel="nofollow"&gt;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411487&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some people also have troubles when using php5 compiled with its own 3rd party libraries instead of system libraries. Check here &lt;a class="" href="http://www.djangoproject.com/documentation/modpython/#if-you-get-a-segmentation-fault" rel="nofollow"&gt; &lt;/a&gt;&lt;a href="http://www.djangoproject.com/documentation/modpython/#if-you-get-a-segmentation-fault" rel="nofollow"&gt;&lt;/a&gt;&lt;a href="http://www.djangoproject.com/documentation/modpython/#if-you-get-a-segmentation-fault" rel="nofollow"&gt;http://www.djangoproject.com/documentation/modpython/#if-you-get-a-segmentation-fault&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;See also: &lt;span&gt;[TracGuide]&lt;/span&gt;, &lt;a class="alink" href="/p/deepmethod/wiki/TracInstall"&gt;[TracInstall]&lt;/a&gt;, &lt;a class="" href="/p/deepmethod/wiki/TracModWSGI"&gt;ModWSGI&lt;/a&gt;, &lt;a class="" href="../TracFastCgi"&gt;FastCGI&lt;/a&gt;, &lt;a class="" href="http://trac.edgewall.org/intertrac/TracNginxRecipe" rel="nofollow"&gt; TracNginxRecipe&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KKozlov</dc:creator><pubDate>Wed, 11 Feb 2015 12:39:49 -0000</pubDate><guid>https://sourceforge.nete055d884e51a64d576d051396b480b900e8a9873</guid></item></channel></rss>