| 52 | For using two projects with lighttpd add the following to your lighttpd.conf: |
| 53 | {{{ |
| 54 | fastcgi.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 | }}} |
| 74 | Note that field values are different. |
| 75 | |
| 76 | For authentication you should enable mod_auth in lighttpd.conf 'server.modules', select auth.backend and auth rules: |
| 77 | {{{ |
| 78 | server.modules = ( |
| 79 | ... |
| 80 | "mod_auth", |
| 81 | ... |
| 82 | ) |
| 83 | |
| 84 | auth.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 | |
| 100 | auth.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 | }}} |
| 114 | Note that lighttpd doesn't support 'valid-user' in versions prior to 1.3.16. |
| 115 | |