Changes between Version 338 and Version 339 of TracInstall
- Timestamp:
- Feb 27, 2011, 11:46:04 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracInstall
v338 v339 275 275 - [wiki:TracFastCgi FastCGI] 276 276 - [wiki:TracModWSGI mod_wsgi] 277 - [wiki:TracModPython mod_python] (no longer recommended, as mod_python is not actively maintained anymore)278 - //[wiki:TracCgi CGI] // (should not be used, as the performance is far from optimal)277 - //[wiki:TracModPython mod_python] (no longer recommended, as mod_python is not actively maintained anymore)// 278 - //[wiki:TracCgi CGI] (should not be used, as the performance is far from optimal)// 279 279 280 280 Trac also supports [trac:TracOnWindowsIisAjp AJP] which may be your choice if you want to connect to IIS. Other deployment scenarios are possible: [trac:TracNginxRecipe nginx], [http://projects.unbit.it/uwsgi/wiki/Example#Traconapacheinasub-uri uwsgi], etc. … … 299 299 Web servers such as [http://httpd.apache.org/ Apache] allow you to create “Aliases” to resources, giving them a virtual URL that doesn't necessarily reflect the layout of the servers file system. We also can map requests for static resources directly to the directory on the file system, avoiding processing these requests by Trac itself. 300 300 301 There are two primary URL paths for static resources - `/chrome/common` and `/chrome/site`. Plugins can add their own resources usually accessible by `/chrome/plugin` path, so its important to override only known paths and not try to make universal `/chrome` alias for everything.302 303 Note that in order to get those static resources on the filesystem, you need first to extract the relevant Trac resources using the `deploy` command of TracAdmin:301 There are two primary URL paths for static resources - `/chrome/common` and `/chrome/site`. Plugins can add their own resources, usually accessible by `/chrome/<plugin>` path, so its important to override only known paths and not try to make universal `/chrome` alias for everything. 302 303 Note that in order to get those static resources on the filesystem, you need first to extract the relevant resources from Trac using the [TracAdmin trac-admin]` <environment> deploy` command: 304 304 [[TracAdminHelp(deploy)]] 305 305 306 See the `htdocs` directory within the target `<directory>`. 306 The target `<directory>` will then contain an `htdocs` directory with: 307 - `site/` - a copy of the environment's directory `htdocs/` 308 - `common/` - the static resources of Trac itself 309 - `<plugins>/` - one directory for each resource directory managed by the plugins enabled for this environment 307 310 308 311 ===== Example: Apache and `ScriptAlias` ===== #ScriptAlias-example 312 313 Assuming the deployment has been done this way: 314 {{{ 315 $ trac-admin /var/trac/env deploy /path/to/trac/htdocs/common 316 }}} 309 317 310 318 Add the following snippet to Apache configuration ''before'' the `ScriptAlias` or `WSGIScriptAlias` (which map all the other requests to the Trac application), changing paths to match your deployment: … … 312 320 Alias /trac/chrome/common /path/to/trac/htdocs/common 313 321 Alias /trac/chrome/site /path/to/trac/htdocs/site 322 314 323 <Directory "/path/to/www/trac/htdocs"> 315 324 Order allow,deny … … 325 334 }}} 326 335 327 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. 328 329 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): 330 336 Note that we mapped `/trac` part of the URL to the `trac.*cgi` script, and the path `/trac/chrome/common` is the path you have to append to that location to intercept requests to the static resources. 337 338 Similarly, if you have static resources in a project's `htdocs` directory (which is referenced by `/trac/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): 331 339 {{{ 332 340 Alias /trac/chrome/site /path/to/projectenv/htdocs 341 333 342 <Directory "/path/to/projectenv/htdocs"> 334 343 Order allow,deny … … 337 346 }}} 338 347 339 Alternatively to aliasing `/trac/chrome/common` and `/trac/chrome/site`, you can tell Trac to generate special links for those static resources, using the [[wiki:TracIni#trac-section| [trac] htdocs_location]] configuration setting:348 Alternatively to aliasing `/trac/chrome/common`, you can tell Trac to generate direct links for those static resources (and only those), using the [[wiki:TracIni#trac-section| [trac] htdocs_location]] configuration setting: 340 349 {{{ 341 350 [trac] 342 htdocs_location = http://static.example.org/trac- htdocs351 htdocs_location = http://static.example.org/trac-common/ 343 352 }}} 344 353 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 355 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: 347 356 {{{ 348 $ ln -s /path/to/ www/trac/htdocs /var/www/yourhost.example.org/trac-htdocs357 $ ln -s /path/to/trac/htdocs/common /var/www/static.example.org/trac-common 349 358 }}} 350 359