9 | | Trac can be run on top of mod_wsgi with the help of the following application script, which is just a Python file, though usually saved with a `.wsgi` extension. |
| 9 | Trac can be run on top of mod_wsgi with the help of an application script, which is just a Python file saved with a `.wsgi` extension. |
| 10 | |
| 11 | A robust and generic version of this file can be created using the `trac-admin <env> deploy <dir>` command which automatically substitutes the required paths, see TracInstall#cgi-bin. The script should be sufficient for most installations and users not wanting more information can proceed to [#Mappingrequeststothescript configuring Apache]. |
| 12 | |
| 13 | If you are using Trac with multiple projects, you can specify their common parent directory using the `TRAC_ENV_PARENT_DIR` in trac.wsgi: |
| 14 | {{{#!python |
| 15 | def application(environ, start_request): |
| 16 | # Add this to config when you have multiple projects |
| 17 | environ.setdefault('trac.env_parent_dir', '/usr/share/trac/projects') |
| 18 | .. |
| 19 | }}} |
62 | | |
63 | | === Recommended `trac.wsgi` script |
64 | | |
65 | | A somewhat robust and generic version of this file can be created using the `trac-admin <env> deploy <dir>` command which automatically substitutes the required paths, see TracInstall#cgi-bin. |
66 | | |
67 | | If you are using Trac with multiple projects, you can specify their common parent directory using the `TRAC_ENV_PARENT_DIR` in trac.wsgi: '' |
68 | | |
69 | | {{{#!python |
70 | | def application(environ, start_request): |
71 | | # Add this to config when you have multiple projects |
72 | | environ.setdefault('trac.env_parent_dir', '/usr/share/trac/projects') |
73 | | .. |
74 | | }}} |