| 29 | |
| 30 | == Even easier method for hosting multiple projects in one domain with Apache 2 == |
| 31 | |
| 32 | Alternatevely, you can exploit the pattern matching feature of the Apache 2 directives: |
| 33 | |
| 34 | {{{ |
| 35 | ScriptAliasMatch "/trac/(.*)/trac.cgi(.*)" "/usr/share/trac/cgi-bin/trac.cgi$2" |
| 36 | <LocationMatch "/trac/(.*)/trac.cgi"> |
| 37 | SetEnvIf Request_URI "/trac/(.*)/trac.cgi" TRAC_ENV=/var/trac/$1 |
| 38 | </LocationMatch> |
| 39 | <LocationMatch "/trac/(.*)/trac.cgi/login"> |
| 40 | AuthType basic |
| 41 | AuthName "myproj - trac" |
| 42 | AuthUserFile "/var/svn/svn-auth-file" |
| 43 | Require valid-user |
| 44 | </LocationMatch> |
| 45 | |
| 46 | Alias /trac "/usr/share/trac/htdocs" |
| 47 | }}} |
| 48 | |
| 49 | In this case each project gets the URL like "http://example.com/trac/someproject/trac.cgi". |