Edgewall Software

Changes between Version 18 and Version 19 of TracFastCgi


Ignore:
Timestamp:
Nov 11, 2005, 3:12:43 PM (18 years ago)
Author:
vyt@…
Comment:

About auth and two projects configuration with lighttpd

Legend:

Unmodified
Added
Removed
Modified
  • TracFastCgi

    v18 v19  
    5050Note that you will need to add a new entry to `fastcgi.server` for each separate Trac instance that you wish to run. Alternatively, you may use the `TRAC_ENV_PARENT_DIR` variable instead of `TRAC_ENV` as described  above.
    5151
     52For using two projects with lighttpd add the following to your lighttpd.conf:
     53{{{
     54fastcgi.server = ("/first" =>
     55                   ("first" =>
     56                    ("socket" => "/tmp/trac-fastcgi-first.sock",
     57                     "bin-path" => "/path/to/cgi-bin/trac.fcgi",
     58                     "check-local" => "disable",
     59                     "bin-environment" =>
     60                       ("TRAC_ENV" => "/path/to/projenv-first")
     61                    )
     62                  ),
     63                  "/second" =>
     64                    ("second" =>
     65                    ("socket" => "/tmp/trac-fastcgi-second.sock",
     66                     "bin-path" => "/path/to/cgi-bin/trac.fcgi",
     67                     "check-local" => "disable",
     68                     "bin-environment" =>
     69                       ("TRAC_ENV" => "/path/to/projenv-second")
     70                    )
     71                  )
     72                )
     73}}}
     74Note that field values are different.
     75
     76For authentication you should enable mod_auth in lighttpd.conf 'server.modules', select auth.backend and auth rules:
     77{{{
     78server.modules              = (
     79...
     80  "mod_auth",
     81...
     82)
     83
     84auth.backend               = "htpasswd"
     85
     86# Separated password files for each project
     87# See "Conditional Configuration" in
     88# http://trac.lighttpd.net/trac/file/branches/lighttpd-merge-1.4.x/doc/configuration.txt
     89
     90$HTTP["url"] =~ "^/first/" {
     91  auth.backend.htpasswd.userfile = "/path/to/projenv-first/htpasswd.htaccess"
     92}
     93$HTTP["url"] =~ "^/second/" {
     94  auth.backend.htpasswd.userfile = "/path/to/projenv-second/htpasswd.htaccess"
     95}
     96
     97# Enable auth on trac URLs, see
     98# http://trac.lighttpd.net/trac/file/branches/lighttpd-merge-1.4.x/doc/authentication.txt
     99
     100auth.require = ("/first/login" =>
     101                ("method"  => "basic",
     102                 "realm"   => "First project",
     103                 "require" => "valid-user"
     104                ),
     105                "/second/login" =>
     106                ("method"  => "basic",
     107                 "realm"   => "Second project",
     108                 "require" => "valid-user"
     109                )
     110               )
     111
     112
     113}}}
     114Note that lighttpd doesn't support 'valid-user' in versions prior to 1.3.16.
     115
    52116Other important information like [http://trac.lighttpd.net/trac/wiki/TracInstall this updated TracInstall page], [wiki:TracCgi#MappingStaticResources and this] are useful for non-fastcgi specific installation aspects.
     117
     118If you use trac-0.9, read [http://lists.edgewall.com/archive/trac/2005-November/005311.html about small bug]
    53119
    54120Relaunch lighttpd, and browse to `http://yourhost.example.org/trac` to access Trac.