Changes between Version 2 and Version 3 of TracModPython


Ignore:
Timestamp:
May 2, 2019, 9:45:05 AM (15 months ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracModPython

    v2 v3  
    66Trac supports [http://www.modpython.org/ mod_python], which speeds up Trac's response times considerably, especially compared to [TracCgi CGI], and permits use of many Apache features not possible with [wiki:TracStandalone tracd]/mod_proxy.
    77
     8These instructions are for Apache 2. If you are using Apache 1.3, you may have some luck with [trac:wiki:TracModPython2.7 TracModPython2.7], but that is a deprecated setup.
     9
    810[[PageOutline(2-3,Overview,inline)]]
    911
    10 == Simple configuration: single project #Simpleconfiguration
     12== Simple configuration: single project == #Simpleconfiguration
    1113
    1214If you just installed mod_python, you may have to add a line to load the module in the Apache configuration:
     
    3537{{{#!apache
    3638<Location /mpinfo>
    37   SetHandler mod_python
    38   PythonInterpreter main_interpreter
    39   PythonHandler mod_python.testhandler
    40   # For Apache 2.2
    41   <IfModule !mod_authz_core.c>
    42     Order allow,deny
    43     Allow from all
    44   </IfModule>
    45   # For Apache 2.4
    46   <IfModule mod_authz_core.c>
    47     Require all granted
    48   </IfModule>
     39   SetHandler mod_python
     40   PythonInterpreter main_interpreter
     41   PythonHandler mod_python.testhandler
     42   Order allow,deny
     43   Allow from all
    4944</Location>
    5045}}}
     
    5348{{{#!apache
    5449<Location /projects/myproject>
    55   SetHandler mod_python
    56   PythonInterpreter main_interpreter
    57   PythonHandler trac.web.modpython_frontend
    58   PythonOption TracEnv /var/trac/myproject
    59   PythonOption TracUriRoot /projects/myproject
    60   # For Apache 2.2
    61   <IfModule !mod_authz_core.c>
    62     Order allow,deny
    63     Allow from all
    64   </IfModule>
    65   # For Apache 2.4
    66   <IfModule mod_authz_core.c>
    67     Require all granted
    68   </IfModule>
     50   SetHandler mod_python
     51   PythonInterpreter main_interpreter
     52   PythonHandler trac.web.modpython_frontend
     53   PythonOption TracEnv /var/trac/myproject
     54   PythonOption TracUriRoot /projects/myproject
     55   Order allow,deny
     56   Allow from all
    6957</Location>
    7058}}}
     
    360348'''Note''': For the above configuration to have any effect it must be put after the configuration of your project root location, ie {{{<Location /myproject />}}}.
    361349
    362 **Note:** Do not enable python optimizations using the directive `PythonOptimize On`. When optimizations are enabled the page header/footer and documentation for macros and plugins will be hidden. An error will be raised in Trac 1.0.11 and later when optimizations are enabled.
     350Also, setting `PythonOptimize On` seems to mess up the page headers and footers, in addition to hiding the documentation for macros and plugins (see #Trac8956). Considering how little effect the option has, leave it `Off`.
    363351
    364352=== HTTPS issues