Hi!

  The past week John, asked about a few weird problems configuring
  Trac with Cherokee using FastCGI, so here is a quick update on how
  to configure it.

  First of all, you have to run Cherokee >= 0.4.31b18 (or SVN 228). I
  have committed a few changes needed for executing it properly.

  So, lets go.. lets get moving. The first thing is let Trac know that
  we want to execute a FastCGI server. Actually, this is a little
  issue that we will have to work out; by default Trac tries to use a
  tricky FastCGI mechanism that is disabled in Cherokee by default.

  In order to fix the default Trac behaviour we will need to edit its
  fcgi_frontend.py file. In my distribution it is placed in:

     /usr/lib/python2.3/site-packages/trac/web/fcgi_frontend.py

  Inside the "run" function, at the beginning of the file, we have to
  replace: "_fcgi.Server(_handler).run()" by:

     _fcgi.Server(_handler, bindAddress=("localhost", 8000)).run()

  We are basically telling the Trac where we want the FastCGI server
  to listen. (Yeah, believe it or not, there isn't a command line
  parameter <sigh!>)

  Now, it is time to configure Cherokee.  This is the small
  configuration file that I have used for my tests.  Note the order of
  the entries, it is very important (remember, the precedence is
  defined by it, the last entry is the highest priority).

=========
Documentroot /var/www/

Directory / {
   Handler common
}

Directory /trac {
   Handler fcgi {
       ErrorHandler on
       CheckFile off
       Server localhost:8000 {
          Env TRAC_ENV "/var/projects/test1"
          Interpreter "/usr/share/trac/cgi-bin/trac.fcgi"
       }
   }
}

Request "^/trac/[^/]+/chrome/common/(.*)$" {
   Handler redir {
      Show Rewrite "/trac/chrome/common/$1"
   }
}

Directory /trac/chrome/common {
   Handler file
   DocumentRoot /usr/share/trac/htdocs/
}
=========

  And, that is all!

  By the way, it worth using FastCGI rather than CGI for Trac, it is
  way faster.  Enjoy! :-)

-- 
Greetings, alo.
http://www.alobbs.com
_______________________________________________
Cherokee mailing list
[email protected]
http://www.0x50.org/cgi-bin/mailman/listinfo/cherokee

Reply via email to