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. |
| 280 | Application scripts for CGI, FastCGI and mod-wsgi can be generated using the [TracAdmin trac-admin] `deploy` command: |
| 281 | [[TracAdminHelp(deploy)]] |
| 282 | |
| 283 | Grant the web server execution right on scripts in the `cgi-bin` directory. |
| 284 | |
| 285 | For 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 |
| 291 | cgi-bin htdocs |
| 292 | $ chmod ugo+x /var/www/cgi-bin/* |
| 293 | }}} |
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: |
| 303 | A 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 | |
| 305 | The `deploy` command creates an `htdocs` directory with: |