Changes between Version 4 and Version 5 of TracModPython2.7
- Timestamp:
- Feb 22, 2015, 3:11:28 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracModPython2.7
v4 v5 1 = Trac and mod_python 2.7 =1 = Trac and mod_python 2.7 2 2 3 3 TracModPython setup is for Apache 2, but it may be possible to work with Apache 1.3. 4 4 5 == Installing mod_python ==5 == Installing mod_python 6 6 7 7 These instructions below have worked for: … … 10 10 * Trac 0.11dev-r6202 11 11 12 First, make sure that the python in the {{{$PATH}}} is the python you want to use (you can revert it later): 12 First, make sure that the Python in the {{{$PATH}}} is the Python you want to use (you can revert it later): 13 13 14 {{{ 14 15 sudo mv /usr/bin/python /usr/bin/python.back … … 17 18 18 19 Then download and build the [http://www.modpython.org/ mod_python] 2.7 module. Use the most recent 2.7 version, mine was 2.7.11: 20 19 21 {{{ 20 22 curl http://www.axint.net/apache/httpd/modpython/mod_python-2.7.11.tgz > mod_python-2.7.11.tgz … … 29 31 CFLAGS=$(OPT) $(INCLUDES) 30 32 }}} 33 31 34 into: 35 32 36 {{{ 33 37 CFLAGS=$(OPT) $(INCLUDES) -DEAPI 34 38 }}} 35 39 36 Then, do the build: 40 Then do the build: 41 37 42 {{{ 38 43 make clean … … 43 48 {{{mod_python}}} is now installed. 44 49 45 == Configurating and testing mod_python ==50 == Configurating and testing mod_python 46 51 47 52 You must add the following lines to your {{{httpd.conf}}}: 53 48 54 {{{ 49 55 LoadModule python_module libexec/mod_python.so 50 56 }}} 51 (The actual path to mod_python.so may vary, but make install should report at the very end exactly where mod_python.so was placed and how the LoadModule directive should appear), and 57 58 The actual path to `mod_python.so` may vary, but make install should report at the very end exactly where `mod_python.so` was placed and how the !LoadModule directive should appear, and 52 59 {{{ 53 60 AddModule mod_python.c 54 61 }}} 55 62 56 You can test that everything is OK using the instructions on http://www.modpython.org/live/mod_python-2.7.8/doc-html/inst-testing.html 63 You can test that everything is OK using the instructions on http://www.modpython.org/live/mod_python-2.7.8/doc-html/inst-testing.html. 64 Then, modify the settings for your Trac instance into: 57 65 58 Then, modify the settings for your Trac instance into:59 66 {{{ 60 67 <Location /projects/myproject> … … 65 72 </Location> 66 73 }}} 67 Of course, use your own values for {{{/projects/myproject}}} and {{{/var/trac/myproject}}}. {{{TracUriRoot}}} may not be necessary; if you remove it, you will need to modify the patch below. 74 75 Of course, use your own values for {{{/projects/myproject}}} and {{{/var/trac/myproject}}}. {{{TracUriRoot}}} may not be necessary. If you remove it, you will need to modify the patch below. 68 76 69 77 Restart Apache after each configuration change. 70 78 71 == Patching Trac ==79 == Patching Trac 72 80 73 81 At this stage, opening http://localhost/projects/myproject in your browser will likely return an error 500. You can look in the {{{error_log}}} file: it is likely a Python exception, because the {{{trac.web.modpython_frontend}}} code tries to use APIs from mod_python that are different in 3.3. … … 139 147 }}} 140 148 141 == Known issues with these instructions ==149 == Caveats 142 150 143 * The patch removes a few functionalities (such as setting up the PYTHON_EGG_CACHE): if you need them, you will need to modify the patch. 144 145 * There may be a character set issue (the non-ascii chars may not be working properly). It is probably easy to fix. 146 151 * The patch removes a few functionalities, such as setting up the PYTHON_EGG_CACHE: if you need them, you will need to modify the patch. 152 * There may be a character set issue: the non-ASCII chars may not be working properly. It is probably easy to fix. 147 153 * In my setup, the performance was not improved by moving to {{{mod_python}}}, but it is likely an issue with the database access.