-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here's a lightly modified version of my lighttpd configuration for trac.
It's been ages since I set it up, though, so I'm not too sure which
critical piece you are missing, but I know this config works ;)
Hopefully the example will get you to where you need to be.

CM Lubinski

## Trac Hosting

$HTTP["scheme"] == "https" {
    $HTTP["host"] == "trac.example.com" {
        $HTTP["url"] =~ "^/projects/" {
            server.document-root = "/var/www/trac"
            auth.backend = "htpasswd"
            auth.backend.htpasswd.userfile =
"/etc/trac/lighttpd.trac.user.htpasswd"
            auth.require = (
                "/projects/proj1/login" => (
                    "method" => "basic",
                    "realm" => "Proj1",
                    "require" => "valid-user"
                    ),
                "/projects/proj2/login" => (
                    "method" => "basic",
                    "realm" => "Proj2",
                    "require" => "valid-user"
                    ),
                )

            fastcgi.server    = (
                "/projects" => ((
                    "socket"          => "/tmp/trac-fastcgi.sock",
                    "bin-path"        =>
"/usr/share/pyshared/trac/web/fcgi_frontend.py",
                    "check-local"     => "disable",
                    "bin-environment" => (
                        "TRAC_ENV_PARENT_DIR" => "/etc/trac",
                        "PYTHON_EGG_CACHE" => "/var/www/trac",
                    )
                ))
            )
        } else $HTTP["url"] =~ "[^^(/projects/)]" {
            url.redirect = ("^/(.*)" =>
"https://trac.example.com/projects/$1";)
        }
    } # end of $HTTP["host"] == "trac.example.com"
} else $HTTP["scheme"] == "http" {
    $HTTP["host"] == "trac.example.com" {
        url.redirect = ("^/(.*)" => "https://trac.example.com/$1";)
    }
}



John wrote:
> Bump?
> 
> On Feb 3, 3:10 pm, John <[email protected]> wrote:
>> Apologies in advance if this has been answered before, but I can't
>> seem to find the details in the archives.  I'm having a devil of a
>> time setting up virtual hosting on lighttpd with Trac 0.11, and I'd
>> really like to avoid going to Apache if I can.  What's happening is
>> that while I can get to trac.example.com, none of the stylesheets,
>> images, etc, are showing up and the login link is broken. Here's the
>> relevant config:
>>
>> $HTTP["host"] =~ "trac.example.com" {
>>      url.rewrite = (
>>           "^(/trac/.*)$" => "$1",
>>           "^(/.*)$" => "/trac/$1"
>>      )
>>
>>      alias.url = ( "/trac" => "/usr/local/trac/site/htdocs/" )
>>
>>      # 0.11 if installed with easy_setup, it is inside the egg
>> directory
>>      var.trac_fcgi_binary="/usr/local/bin/python /usr/local/lib/
>> python2.6/site-packages/Trac-0.11-py2.6.egg/trac/web/
>> fcgi_frontend.py"
>>
>>      fastcgi.server = ("/" =>
>>           ("trac" =>
>>                ("socket" => "/tmp/trac-fastcgi.sock",
>>                             "bin-path" => trac_fcgi_binary,
>>                             "check-local" => "disable",
>>                             "bin-environment" =>
>>                                  ("TRAC_ENV" => "/usr/local/trac/
>> site")
>>                )
>>           )
>>      )
>>
>>      $HTTP["url"] =~ "^/login$" {
>>           auth.require = ("/" =>
>>                               (
>>                                "method"  => "digest",
>>                                "realm"   => "myrealm",
>>                                "require" => "valid-user"
>>                               )
>>                          )
>>      }
>>
>> }
>>
>> This is on FreeBSD 8.0 if that helps.  Any assistance would be greatly
>> appreciated.
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.12 (Darwin)

iEYEARECAAYFAktvpfcACgkQfzi1OiZiJLBekgCfbUzoG889z1SmzT7qCcdaEL0w
JTQAn2s188zs23pptv5+fVAwBKoSv1im
=mqXS
-----END PGP SIGNATURE-----

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

Reply via email to