If you want trac to run faster, use mod_wsgi (which is faster than mod_python, both of which are faster than CGI). This can be installed as an apache module from source or from a binary package (see yum or apt-get). When install MoinMoin, I found the different between mod_python and wsgi to be significant. Just noticed, your stumbling block is that python web apps have to be configured in Apache before they will run (it doesn't work like PHP or CGI application).
To setup trac for WSGI:
- create an apache directory in your trac install (mkdir /trac/apache)
- create a wsgi file for trac in /trac/apache (listed below)
- create an eggs directory in your trac install (mkdir /trac/eggs)
- add the following to your apache conf (use include files for readability)
- change ownership of trac to the web server (chown -R apache /trac)
WSGIScriptAlias /trac /trac/apache/trac.wsgi
## This is required if you plan to use HTTP authorization. Without it the
## user name won't be passed
<Directory /trac/apache >
Allow from all
AuthName "Trac at My Company"
sys.stdout = sys.stderr
os.environ['TRAC_ENV'] = '/trac'
os.environ['PYTHON_EGG_CACHE'] = '/trac/eggs'
application = trac.web.main.dispatch_request
To setup Trac for mod_python, you could follow the instructions at TracModPython, copied here for your reading pleasure:
PythonOption TracEnv /var/trac/myproject
PythonOption TracUriRoot /projects/myproject