308 | | Note that '''authFile''' must exist, and be a file (not directory) that can be accessed via ''authentication_url''. With Trac running under WSGI, making this happen is not obvious. There are 4 ways you can do this: |
309 | | 1. You can place a 0-length file called authFile somewhere under the Apache !DocumentRoot but outside of the Trac project. A standard ''authentication_url'' value can then be used, but this may make your project more difficult to maintain, especially if you host multiple projects and need authentication to be specific to each project. |
310 | | 1. Put authFile in your project's htdocs directory, and change ''authentication_url'' to: |
311 | | {{{ |
312 | | authentication_url = http://hostname/trac/chrome/site/authFile |
313 | | }}} |
314 | | and ''Location'' to: |
315 | | {{{ |
316 | | <Location /trac/chrome/site/authFile> |
317 | | }}} |
318 | | This has the advantage that your Trac project need not be under Apache's !DocumentRoot, thereby making it more secure. |
319 | | 1. Follow the directions in the [http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines WSGI Configuration Guidelines] article's "Hosting Of Static Files" section on how to exempt specific paths from being routed through WSGI. With this method, a standard ''authentication_url'' value can be used, and authFile can be placed where you like within the Trac environment. Note that if your Trac projects are not under !DocumentRoot, you will need an 'Allow all' directive within your <Location> section. |
320 | | 1. Contrary to the recommendation in the WSGI article above, you could use the !SetHandler directive to reset the Apache content handler back to 'None' for URLs mapped to static files. This would work in a similar fashion to example 3. |
| 310 | Note that '''authFile''' need not exist. See the !HttpAuthStore link above to see examples where multiple Trac projects are hosted on a server. |