== trac 11rc1 + MySQL + mod_python on Slackware 12.1 ==
This guide isn't exactly a HOWTO but in fact the step's I took to install trac. Hope it helps.
=== Subversion with SWIG ===
One of the requirements is that subversion be compiled with SWIG support, therefore if you are using the supplied package then you will need to recompile. To do so follow the following steps:
* Remove installed subversion package;
* Compile and install swig from slackbuilds
* Get subversion build scripts and source from source cd
* Edit build script and include --with-swig in configuration options
* Recompile subversion & install new subversion package
* In subversion source directory (probably in /tmp) do:
{{{
make swig-py
make install-swig-py
}}}
=== trac installation ===
Once subversion has been recompiled trac installation can proceed. First install ez_setup:
{{{
python ez_setup.py
}}}
Next install Genshi:
{{{
easy_install Genshi
}}}
And finally trac
{{{
easy_install Trac==0.11rc1
}}}
=== MySQL ===
* Install MySQL package from Slackware (make sure everything is up and running before proceding)
* Compile and install pysetuptools from slackbuilds
* Compile and install mysql-python from slackbuilds
* Set-up the trac database
{{{
mysql -u root -p
create database trac DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE trac;
CREATE USER tracuser IDENTIFIED BY 'password';
GRANT ALL ON trac.* TO tracuser;
}}}
For above example connection string will be: mysql://tracuser:password@localhost/trac.
=== Set-up trac ===
First create project
{{{
trac-admin /path/to/myproject initenv
}}}
=== Apache Set-up ===
* Compile and install mod_python from slackbuilds
* Configure apache to test Python installation add (location only for tests)
{{{
LoadModule python_module lib/httpd/modules/mod_python.so to httpd.conf
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler mod_python.testhandler
}}}
* Make sure PYTHONPATH is set and that apache can see it. (VERY IMPORTANT)
{{{
export PYTHONPATH=$PYTHONPATH:/usr/lib/svn-python
}}}
* Restart apache
* Point browser to http://localhost/mpinfo (you should see info and if so location can now be removed)
* Next add to httpd.conf Virtualhost config (or any other setup you would like)
Notes: This VirtualHost config if for multiple projects
{{{
DocumentRoot /path/to/trac
Allow from all
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /path/to/trac
PythonOption TracUriRoot /
# used for authentication (refer to manual for more info)
#
# AuthName "Trac"
# AuthType Basic
# AuthUserFile /path/to/trac/.htpasswd
# Require valid-user
# Options FollowSymLinks
# Order allow,deny
# Allow from all
#
}}}
* Restart apache again
* Point to virtualhost and all should be working (unless I forgot to document some step I took)
Hope this helps,
icebrian