Tomek Piatek wrote:
Hi All,
I've just spent a whole bloody day trying to get Trac to work with FastCGI
through LighHTTPd. I got it all going in the end but there is one oddity
which really bugs me. I have a host named trac.mydomain.com. I've set up
Trac/FastCGI in lighttp to serve multiple projects off
http://trac.mydomain.com. When I go to that URL I get the page which lists
all the Trac projects. Great so far. But when I click on any project it
takes me back to the project list page. If I then click again on a project
link it will finally take me to that project's starting page. For example,
http://trac.mydomain.com/test does not take me to the "test" project but
back to the same page at which point the link for "test" becomes
"http://trac.mydomain.com/test/test".
This link then works. In fact to get to any project I can type any garbage
in the URL between the host name and the project name, like so:
http://trac.mydomain.com/anygarbagehere/test.
People have reported this before on various mailing lists and I've tried
following their solutions but none of their fixes work for me. Here's my
LigHTTPd section for Trac. Notice that I had to explicitly specify the
document root because my LigHTTP server serves multiple sites. This is the
closest that I can get to a fully working solution. Any help would be
greatly appreciated.
$HTTP["host"] =~ "trac.mydomain.com" {
server.document-root = "/projects/trac"
debug.log-request-handling = "enable"
debug.log-request-header = "enable"
debug.log-response-header = "enable"
debug.log-file-not-found = "enable"
alias.url = (
"/chrome/common" => "/usr/share/trac/htdocs",
"/favicon.ico" => "/usr/share/trac/htdocs/trac.ico"
)
$HTTP["url"] =~ "^(/chrome/|/favicon.ico$)" {
# Handle these as static files
}
else $HTTP["url"] =~ "^/" {
fastcgi.server = ( "/" =>
( "trac" =>
( "socket" => "/tmp/trac- fastcgi.sock",
"check-local" => "disable",
"min-procs" => 1,
"max-procs" => 1,
"bin-path" => "/usr/share/trac/cgi-bin/trac.fcgi",
"bin-environment" => ( "TRAC_ENV_PARENT_DIR" =>
"/projectx/trac",
"TRAC_URI_ROOT" => "/" )
)
)
)
}
auth.require = ("/" => ("method" => "basic",
"realm" => "projects",
"require" => "valid-user"))
}
------------------------------------------------------------------------
Hey,
I had similar problems to setup this environment too.
Here is my config, but some parts could be unnecessary or even wrong,
but it works:
--------------------
$HTTP["host"] =~ "(trac.foobar.com|trac.foobar.de)" {
var.servername = "trac.foobar.com"
accesslog.filename = basedir + servername + "/logs/access.log"
alias.url = (
"/trac_prefix/chrome/common/" => "/usr/share/trac/htdocs/",
"/favicon.ico" =>
"/usr/share/trac/htdocs/trac.ico",
"" =>
"/usr/share/trac/cgi-bin/trac.fcgi",
)
# rewrite for multiple svn project
url.rewrite-final = (
"^/trac_prefix/[^/]+/chrome/common/(.*)" =>
"/chrome/common/$1",
)
$HTTP["url"] =~ "^(/chrome/|/favicon.ico$)" {
# no fastcgi
}
else $HTTP["url"] =~ "^/" {
fastcgi.server = (
"/" => (
"trac.cgi" => (
"bin-path" =>
"/usr/share/trac/cgi-bin/trac.fcgi",
"socket" => "/tmp/trac.sock",
"check-local" => "enable",
"disable-time" => 1,
"min-procs" => 1,
"max-procs" => 1,
"bin-environment" => (
"TRAC_ENV_PARENT_DIR" => "/trac/",
),
),
),
)
}
auth.backend = "htdigest"
auth.backend.htdigest.userfile = "/etc/lighttpd/trac.auth"
$HTTP["url"] =~ "^/.*/login$" {
auth.require = ("/" => (
"method" => "basic",
"realm" => "trac",
"require" => "valid-user"
))
}
}
hth,
Jens
_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac