Installing Trac on Slackware 12.1
This guide lists the steps to install Trac 0.11rc1 on Slackware 12.1 with MySQL and mod_python.
Subversion with SWIG
One of the requirements is that Subversion is compiled with SWIG support. Therefore if you are using the supplied package, then you will need to recompile as follows:
- 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 and 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 setup
- Install MySQL package from Slackware, make sure everything is up and running before proceeding.
- Compile and install pysetuptools from slackbuilds.
- Compile and install mysql-python from slackbuilds.
- Set-up the Trac database in MySQL itself:
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 the above example the connection string will be: mysql://tracuser:password@localhost/trac
.
Trac setup
Create Trac project:
trac-admin /path/to/myproject initenv
Apache setup
- Compile and install mod_python from slackbuilds.
- Configure Apache to test Python installation, add the following to
httpd.conf
(location only for tests):LoadModule python_module lib/httpd/modules/mod_python.so <Location /mpinfo> SetHandler mod_python PythonInterpreter main_interpreter PythonHandler mod_python.testhandler </Location>
- IMPORTANT: Make sure PYTHONPATH is set and that apache can see it:
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.
Note: add this VirtualHost config for multiple projects:
<VirtualHost *:999> DocumentRoot /path/to/trac <Directory "/path/to/trac"> Allow from all </Directory> <Location /> SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir /path/to/trac PythonOption TracUriRoot / </Location> # used for authentication (refer to manual for more info) # <LocationMatch "/[^/]+/login"> # AuthName "Trac" # AuthType Basic # AuthUserFile /path/to/trac/.htpasswd # Require valid-user # Options FollowSymLinks # Order allow,deny # Allow from all # </LocationMatch> </VirtualHost>
- Restart Apache.
- Point to virtualhost and all should be working.