Changes between Version 3 and Version 4 of TracDev/AlternativeFrontends
- Timestamp:
- Jul 27, 2015, 9:22:41 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/AlternativeFrontends
v3 v4 3 3 == Alternative frontend: mod_python 4 4 5 Virtualenv can be used with Apache and mod_python, but as mod_python will be a system install it will not be aware of the virtualenv without some configuration. For development this is useful as one Apachecan serve various development versions in a more permanent way. This method will use the system Python, but will add the libraries from the virtualenv.5 Virtualenv can be used with '''Apache''' and '''mod_python''', but as mod_python will be a system install, it will not be aware of the virtualenv without some configuration. For development this is useful as one Apache server can serve various development versions in a more permanent way. This method will use the system Python, but will add the libraries from the virtualenv. 6 6 7 1. Make a new frontend script that for instance can be stored in the virtualenv `bin` directory. 7 1. Make a new frontend script that for instance can be stored in the virtualenv `bin` directory: 8 8 {{{#!python 9 9 #myvirtualtrac.py … … 15 15 from trac.web.modpython_frontend import handler 16 16 }}} 17 1. Update Apache config to use this script. Add or update options according to the default mod_python setup like for instance found in TracModPython. 17 1. Update Apache config to use this script. Add or update options according to the default mod_python setup like for instance found in TracModPython: 18 18 {{{#!apache 19 19 # Extend the path so Apache will find your script on path … … 26 26 == Alternative frontend: mod_wsgi 27 27 28 Using Apache, mod_wsgi is a very good alternative to mod_python. Setting this up follows the same pattern, but for development especially there is one major advantage: It can quite easily be set up to auto-reload on code changes.28 With Apache, '''mod_wsgi''' is a very good alternative to '''mod_python'''. Setting this up follows the same pattern, but for development especially there is one major advantage: it can quite easily be set up to auto-reload on code changes. 29 29 30 1. Update a default TracModWsgi setup to make a daemonised process, and as of mod_wsgi 2.0 (this setup depends on >= 2.0) there is built-in support for custom paths and similar. Example of a full `VirtualHost` configuration:30 1. Update a default TracModWsgi setup to make a daemonised process, and as of mod_wsgi 2.0 (this setup depends on >= 2.0) there is built-in support for custom paths and similar. Example of a full `VirtualHost` configuration: 31 31 {{{#!apache 32 32 <VirtualHost *:80> … … 61 61 </VirtualHost> 62 62 }}} 63 1. Go to [mod-wsgi:ReloadingSourceCode#Monitoring_For_Code_Changes ReloadingSourceCode] and save the Python script as `/path/to/my/virtualenv/bin/monitor.py`64 1. A basic WSGI frontend script, save as `/path/to/my/virtualenv/bin/virtualtrac.wsgi` 63 1. Go to [mod-wsgi:ReloadingSourceCode#Monitoring_For_Code_Changes ReloadingSourceCode] and save the Python script as `/path/to/my/virtualenv/bin/monitor.py` 64 1. A basic WSGI frontend script, save as `/path/to/my/virtualenv/bin/virtualtrac.wsgi`: 65 65 {{{#!python 66 66