Hi

On May 27, 2:34 pm, Matthias Karbe <[email protected]> wrote:
> Am Mon, 27 May 2013 01:20:53 -0700 (PDT)
> schrieb Feuermurmel <[email protected]>:
>
>
>
>
>
>
>
>
>
> > Hi folks
>
> > I'm trying to set up lighty so it servers a Trac instance under a
> > virtualhost but I have trouble getting it to work correctly, even
> > without using virtualhosts. I've set up a minimal confiiguration for
> > lighty where the Trac instance is server under "/":
>
> > server.modules = ( "mod_fastcgi" )
>
> > server.document-root        = "/dev/null"
> > server.port = 8080
>
> > fastcgi.server = (
> >    "/" => ((
> >            "socket" => "/tmp/lighttpd-fastcgi-1.sock",
> >            "bin-path" =>
> > "/opt/local/Library/Frameworks/Python.framework/
> > Versions/2.6/lib/python2.6/site-packages/trac/web/fcgi_frontend.py",
> > "check-local" => "disable", "bin-environment" => ("TRAC_ENV" => ...,
> > "PYTHON_EGG_CACHE" => "/tmp/ trac_cache")
> >    ))
> > )
>
> > When I access the URLhttp://localhost:8080/in my browser, the Trac
> > instances is loaded but without any styling. When looking at the HTML
> > source, the URLs for the CSS files look reasonable, e.g. the first
> > <link> element:
>
> > > <link rel="stylesheet" href="/chrome/common/css/trac.css"
> > > type="text/css">
>
> > But accessing that location gives an error message from Trac:
>
> > > No handler matched request to /common/css/trac.css
>
> > And the log shows contains the following line:
>
> > > 10:16:27 Trac[main] DEBUG: Dispatching <RequestWithSession "GET
> > > '/common/css/trac.css'">
>
> > Which is weird, the /chrome/ part is missing. Is this a problem of
> > lighttpd or the FastCGI implementation of Trac? When change the
> > lighttpd configuration to serve the instance e.g. under /trac/ instead
> > of /, everything works correctly.
>
> > Many thanks for any help and suggestions!
>
> > Michael
>
> I guess it's sort of Tracs problem when setting up Trac as root handler.
> /trac/chrome/common/* is handled and redirects to /common/* which
> should be in htdocs.
> But if trac is root, /chrome/common/* is redirected
> to /common/* which is itself a trac request. A request that cannot be
> served because there is no handler.
> If you use /trac/ as root, then /common/ is not served by Trac but
> lighttpd from htdocs.
>
> Have a look athttp://trac.edgewall.org/wiki/TracDev/TracURLs
> andhttp://trac.edgewall.org/wiki/TracInstall#MappingStaticResources.
>
> In your single root handler setup, you need to override these uri's so
> they don't get served by Trac.
> In both cases it is better to use alias (mod_alias) for
> <base>/chrome/common uri's to serve them directly from local files
> instead of making a round-trip through fcgi/trac.
>
> --
>
> Something like that should suffice:
>
>   server.modules += ("mod_alias")
>   # serve /chrome/common/* from /var/www/localhost/htdocs/chrome
>   alias.url = ("/chrome/common" => "/var/www/localhost/htdocs/chrome")
>   # everything not matching "/chrome/common/*" is handled by fcgi/trac
>   $HTTP["url"] !~ "^/chrome/common" {
>   fastcgi.server = ("/" =>
>    ...
>
> Have a look 
> athttp://trac.edgewall.org/wiki/TracFastCgi#SimpleLighttpdConfiguration.
> (below the auth setup)
>
> --
>
> You could probably also implement a plugin which serves /common/
> requests from disk randomly.. for colorful trac'ing. ;)
>
> Anyway, hope that was helpful.
>
> Regards,
>   makadev

That instantly solved the problem! For the record, the workaround for
the bug in lighttpd's URL handling described in Jun's message also
works and I have not jet decided which solution I'll implement in
production. (It's a trade-off between efficiency and configuration
complexity. The Trac instance gets about 10 or 20 requests per hour
average, so the server's computing time is definitely not an issue and
I could not measure a difference in latency for loading the page, once
the resources were cached).

Thanks to both of you!

Michael

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to