Edgewall Software

Changes between Version 436 and Version 437 of TracInstall


Ignore:
Timestamp:
Jun 14, 2017, 2:42:43 AM (7 years ago)
Author:
Ryan J Ollos
Comment:

The "chicken and egg" problem as discussed is confusing and doesn't actually seem to be a problem with Trac 1.2.

Legend:

Unmodified
Added
Removed
Modified
  • TracInstall

    v436 v437  
    278278==== Generating the Trac cgi-bin directory #cgi-bin
    279279
    280 In order for Trac to function properly with FastCGI you need to have a `trac.fcgi` file and for mod_wsgi a `trac.wsgi` file. These are Python scripts which load the appropriate Python code. They can be generated using the `deploy` option of [TracAdmin trac-admin].
    281 
    282 There is, however, a bit of a chicken-and-egg problem. The `trac-admin` command requires an existing environment to function, but complains if the deploy directory already exists. This is a problem, because environments are often stored in a subdirectory of the deploy. The solution is to do something like this:
    283 {{{#!sh
    284 $ mkdir -p /usr/share/trac/projects/my-project
    285 $ trac-admin /usr/share/trac/projects/my-project initenv
    286 $ trac-admin /usr/share/trac/projects/my-project deploy /tmp/deploy
    287 $ mv /tmp/deploy/* /usr/share/trac
    288 }}}
    289 Don't forget to check that the web server has the execution right on scripts in the `/usr/share/trac/cgi-bin` directory.
     280Application scripts for CGI, FastCGI and mod-wsgi can be generated using the [TracAdmin trac-admin] `deploy` command:
     281[[TracAdminHelp(deploy)]]
     282
     283Grant the web server execution right on scripts in the `cgi-bin` directory.
     284
     285For example, the following yields a typical directory structure:
     286{{{#!sh
     287$ mkdir -p /var/trac
     288$ trac-admin /var/trac/<project> initenv
     289$ trac-admin /var/trac/<project> deploy /var/www
     290$ ls /var/www
     291cgi-bin htdocs
     292$ chmod ugo+x /var/www/cgi-bin/*
     293}}}
    290294
    291295==== Mapping Static Resources
     
    297301There are two primary URL paths for static resources: `/chrome/common` and `/chrome/site`. Plugins can add their own resources, usually accessible at the `/chrome/<plugin>` path.
    298302
    299 A single `/chrome` alias can used if the static resources are extracted for all plugins. This means that the `deploy` command must be executed after installing or updating a plugin that provides static resources, or after modifying resources in the `$env/htdocs` directory. This is probably appropriate for most installations but may not be what you want if, for example, you wish to upload plugins through the //Plugins// administration page.
    300 
    301 The resources are extracted using the [TracAdmin trac-admin] `<environment> deploy` command:
    302 [[TracAdminHelp(deploy)]]
    303 
    304 The target `<directory>` will contain an `htdocs` directory with:
     303A single `/chrome` alias can used if the static resources are extracted for all plugins. This means that the `deploy` command (discussed in the previous section) must be executed after installing or updating a plugin that provides static resources, or after modifying resources in the `$env/htdocs` directory. This is probably appropriate for most installations but may not be what you want if, for example, you wish to upload plugins through the //Plugins// administration page.
     304
     305The `deploy` command creates an `htdocs` directory with:
    305306 - `common/` - the static resources of Trac
    306307 - `site/` - a copy of the environment's `htdocs/` directory
     
    320321Assuming the deployment has been done this way:
    321322{{{#!sh
    322 $ trac-admin /var/trac/env deploy /path/to/shared/trac
     323$ trac-admin /var/trac/<project> deploy /var/www
    323324}}}
    324325