10
Aug
07

Cherokee + Gentoo + Trac micro HowTo

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:

  1. We define our URL project, where to find it on our disk and where is the trac fcgi
  2. Use this to have auth on trac. The file is create with htpasswd
  3. 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 :)

Advertisements

4 Responses to “Cherokee + Gentoo + Trac micro HowTo”


  1. 1 bob
    10 August, 2007 at 13:03 pm

    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

  2. 11 August, 2007 at 22:34 pm

    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

  3. 3 kpshack
    26 November, 2007 at 11:14 am

    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.

  4. 29 May, 2010 at 17:15 pm

    Haha I am honestly the only comment to this great read!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


del.icio.us

Flickr Photos


%d bloggers like this: