1. Install python and mod_python (for Apache)
1. yum install python mod_python
2. Install MySQL-python
1. Download the tarball from
http://sourceforge.net/projects/mysql-python 2. Compile the package:
python setup.py build && python setup.py install
3. Install Clearsilver, a templating package needed by Trac
1. Download Clearsilver from
http://www.clearsilver.net/downloads/ 2. Compile Clearsilver:
./configure –with-python=/path/to/python && make && make install
3. Note: My path to python is /usr/lib/python2.4
4. Install Trac
1. Download Trac from
http://trac.edgewall.org/wiki/TracDownload 2. Setup Trac:
python ./setup.py install
5. Create a Trac project
1. I’m going to keep all of my Trac projects in /var/www/apps/trac, and for this example, I’ll call my project MyTracProject
2. trac-admin /var/www/apps/trac/MyTracProject initenv
3. Give your project a name of your choosing, but accept the default for all other settings.
6. Install TracWebAdmin
1. Note: This is an optional step, if you would like to administer Trac from within Trac itself. Also, installation of this plugin is only necessary if you’re running Trac version 0.10 or earlier as 0.11 has integrated this plugin into the core Trac package.
2. In a temporaty directory, grab the TracWebAdmin package:
svn co
http://svn.edgewall.com/repos/trac/sandbox/webadmin/ 3. cd webadmin
4. python setup.py egg_info
5. cp dist/TracWebAdmin-0.1.2dev_r5753-py2.4.egg /var/www/apps/trac/MyTracProject/plugins (Note: the actual filename may be different, depending on the build)
6. Enable the plugin by adding the following to your trac.ini found at /var/www/apps/trac/MyTracProject/conf/trac.in
view sourceprint?
1.[components]
2.webadmin.* = enabled
7. Define some Trac users
1. Create a file to store your authorized users:
touch /var/www/apps/trac/auth-file
2. Add a user to the file:
htpasswd -m /var/www/apps/trac/auth-file <username>
8. Give admin permissions to the Trac user
1. trac-admin /var/www/apps/trac/MyTracProject permission add <username> TRAC_ADMIN
9. Configure Apache
1. Load mod_python by editing your httpd.conf (for me this is /etc/httpd/conf/httpd.conf) and add “LoadModule python_module modules/mod_python.so”
2. I want to access Trac via
http://trac.mytrackproject.com 3. You’ll need a CNAME record in your DNS to support the trac.mytrackproject.com subdomain.
4. You’ll also need to create a VirtualHost section in Apache’s httpd.conf file. For example:
view sourceprint?
01.<virtualHost *:80>
02.
03. ServerName trac.mytrackproject.com
04.
05. <location />
06. SetHandler mod_python
07. PythonHandler trac.web.modpython_frontend
08. PythonOption TracEnv /var/www/apps/trac/mytrackproject
09. PythonOption TracUriRoot /
10. </location>
11. <location "/login">
12. AuthType Basic
13. AuthName "trac"
14. AuthUserFile /var/www/apps/trac/auth-file
15. Require valid-user
16. </location>
17.
18.</virtualHost>
10. Restart Apache: service httpd restart
11. Go to
http://trac.mytrackproject.com and start using Trac
Source:
http://www.compulsivoco.com/2008/05/installing-trac-on-centos-5/
All programmers are playwrights and all computers are lousy actors.