237 | | 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]. |
238 | | |
239 | | There is, however, a bit of a chicken-and-egg problem. The [TracAdmin 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: |
240 | | {{{#!sh |
241 | | $ mkdir -p /usr/share/trac/projects/my-project |
242 | | $ trac-admin /usr/share/trac/projects/my-project initenv |
243 | | $ trac-admin /usr/share/trac/projects/my-project deploy /tmp/deploy |
244 | | $ mv /tmp/deploy/* /usr/share/trac |
245 | | }}} |
246 | | Don't forget to check that the web server has the execution right on scripts in the `/usr/share/trac/cgi-bin` directory. |
| 237 | Application scripts for CGI, FastCGI and mod-wsgi can be generated using the [TracAdmin trac-admin] `deploy` command: |
| 238 | [[TracAdminHelp(deploy)]] |
| 239 | |
| 240 | Grant the web server execution right on scripts in the `cgi-bin` directory. |
| 241 | |
| 242 | For example, the following yields a typical directory structure: |
| 243 | {{{#!sh |
| 244 | $ mkdir -p /var/trac |
| 245 | $ trac-admin /var/trac/<project> initenv |
| 246 | $ trac-admin /var/trac/<project> deploy /var/www |
| 247 | $ ls /var/www |
| 248 | cgi-bin htdocs |
| 249 | $ chmod ugo+x /var/www/cgi-bin/* |
| 250 | }}} |
256 | | 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. |
257 | | |
258 | | The resources are extracted using the [TracAdmin trac-admin]` <environment> deploy` command: |
259 | | [[TracAdminHelp(deploy)]] |
260 | | |
261 | | The target `<directory>` will contain an `htdocs` directory with: |
| 260 | 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. |
| 261 | |
| 262 | The `deploy` command creates an `htdocs` directory with: |