328 | | Note that we mapped `/trac` part of the URL to the `trac.cgi` script, and the path `/chrome/common` is the path you have to append to that location to intercept requests to the static resources. |
329 | | |
330 | | For example, if Trac is mapped to `/cgi-bin/trac.cgi` on your server, the URL of the Alias should be `/cgi-bin/trac.cgi/chrome/common`, like so: |
331 | | |
332 | | {{{ |
333 | | Alias /cgi-bin/trac.cgi/chrome/common /path/to/trac/htdocs/common |
334 | | }}} |
335 | | |
336 | | Similarly, if you have static resources in a project's htdocs directory (which is referenced by /chrome/site URL in themes), you can configure Apache to serve those resources (again, put this '''before''' the `ScriptAlias` for the CGI script, and adjust names and locations to match your installation): |
| 328 | Note that we mapped `/trac` part of the URL to the `trac.*cgi` script, and the path `/chrome/common` is the path you have to append to that location to intercept requests to the static resources. |
| 329 | |
| 330 | Similarly, if you have static resources in a project's `htdocs` directory (which is referenced by /chrome/site URL in themes), you can configure Apache to serve those resources (again, put this ''before'' the `ScriptAlias` or `WSGIScriptAlias` for the .*cgi scripts, and adjust names and locations to match your installation): |
349 | | htdocs_location = http://yourhost.example.org/trac-htdocs |
350 | | }}} |
351 | | |
352 | | Trac will then use this URL when embedding static resources into HTML pages. Of course, you still need to make the Trac `htdocs` directory available through the web server at the specified URL, for example by copying (or linking) the directory into the document root of the web server: |
| 343 | htdocs_location = http://static.example.org/trac-htdocs |
| 344 | }}} |
| 345 | Note that this makes it easy to have a dedicated domain serve those static resources (preferentially [http://code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain cookie-less]). |
| 346 | |
| 347 | Of course, you still need to make the Trac `htdocs/common` directory available through the web server at the specified URL, for example by copying (or linking) the directory into the document root of the web server: |