Archive for August, 2007

28
Aug
07

Antonio Puerta tribute

Just a little tribute to Antonio Puerta (1984-2007)…

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 :)




del.icio.us

Flickr Photos







More Photos