On today’s class we will configure our Cherokee web server to work with Trac :)
You need a system with trac, cherokee and apache-utils(htpasswd) installed (on Gentoo just emerge). We will use cherokee 0.5.6 (0.6.x is very stable so the config file is quite different). Remember to install Trac with FCGI support (on gentoo just USE=fcgi).
- First we need to modify a bit the trac fcgi interpreter to work on cherokee. We must to bind the fcgi port, in this case to 8000. Edit:
"/usr/lib/python2.4/site-packages/trac/web/fcgi_frontend.py" change "_fcgi.WSGIServer(dispatch_request).run()" to "_fcgi.WSGIServer(dispatch_request, bindAddress=("localhost", 8000)).run()"
- Now copy the trac cgi to a better location (the location depends on the trac version:
# cp /usr/share/webapps/trac/0.10.3.1/hostroot/cgi-bin/trac.fcgi /var/www/localhost/cgi-bin/
- And the final step, configure cherokee:
Directory /trac/$PROJ {
Handler fcgi {
ErrorHandler on
CheckFile off
Server localhost:8000 {
Env TRAC_ENV "/var/lib/trac/$PROJ"
Interpreter "/var/www/localhost/cgi-bin/trac.fcgi"
}
}
}
Directory /trac/$PROJ/login {
Auth Basic {
Name "Trac auth"
Method htpasswd {
PasswdFile /etc/cherokee/trac.htpasswd
}
}
}
Request "^/trac/[^/]+/chrome/common/(.*)$" {
Handler redir {
Show Rewrite "/trac/chrome/common/$1"
}
}
Request "^/trac/[^/]+/login/chrome/common/(.*)$" {
Handler redir {
Show Rewrite "/trac/chrome/common/$1"
}
}
Directory /trac/chrome/common {
Handler file
DocumentRoot /usr/share/trac/htdocs/
}
I will explain a bit each section:
- We define our URL project, where to find it on our disk and where is the trac fcgi
- Use this to have auth on trac. The file is create with htpasswd
- 4 and 5 are nice redirectors to server static trac content without using the trac cgi
Remember to set perms on /var/lib/trac/$PROJ, to passwd and svn repos to user cherokee.
Now we have a fast and secure Trac system :)



Hi, what make you choose cherokee over other webservers ?
(beside a cool logo :)
I checked benchmarks and hmm some say its so cool other say its crap so yea as usual can’t trust benchmarks.
it seems to have all the required features but.. what’s the advantage for you over apache or lightttpd or zeus or ?
Thanks for your reply
Well, it is fast, light and fully free/libre. It’s active development and 0.6x series will come with a web interface to configure it easily as possible :)
(beside Alo is my friend ;)
Thanks for comment
I am Alvaro’s friend too, and I must admit this was the reason I tried Cherokee the first time.
I must tell I was amazed by the result, my cpu consumption when from 90% to 70% and I got about 100 Mb more free ram when running Cherokee + Gentoo + Zoneminder.
I wrote down all the process in my *new* blog:
http://www.kernel-panik.com/wordpress/2007/11/20/cherokee-php-zoneminder-on-gentoo-linux-how-to/
(sorry if it’s design is still kinda ugly, but I am new in this blogging/publishing stuff)
Jorge S.