Changes between Version 1 and Version 2 of TracModWSGI
- Timestamp:
- May 31, 2020, 9:49:25 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracModWSGI
v1 v2 2 2 3 3 4 [http://code.google.com/p/modwsgi/ mod_wsgi] is an Apache module for running WSGI-compatible Python applications directly on top of the Apache webserver. The mod_wsgi adapter is written completely in C and provides very good performance s.4 [http://code.google.com/p/modwsgi/ mod_wsgi] is an Apache module for running WSGI-compatible Python applications directly on top of the Apache webserver. The mod_wsgi adapter is written completely in C and provides very good performance. 5 5 6 6 [[PageOutline(2-3,Overview,inline)]] … … 24 24 25 25 The `TRAC_ENV` variable should naturally be the directory for your Trac environment (if you have several Trac environments in a directory, you can also use `TRAC_ENV_PARENT_DIR` instead), while the `PYTHON_EGG_CACHE` should be a directory where Python can temporarily extract Python eggs. 26 27 On Windows: 28 - If run under the user's session, the Python Egg cache can be found in `%AppData%\Roaming`, for example: 29 {{{#!python 30 os.environ['PYTHON_EGG_CACHE'] = r'C:\Users\Administrator\AppData\Roaming\Python-Eggs' 31 }}} 32 - If run under a Window service, you should create a directory for Python Egg cache. 33 {{{#!python 34 os.environ['PYTHON_EGG_CACHE'] = r'C:\Trac-Python-Eggs' 35 }}} 26 36 27 37 === A more elaborate script … … 73 83 Here, the script is in a subdirectory of the Trac environment. 74 84 75 If you followed the directions [ http://trac.edgewall.org/wiki/TracInstall#cgi-bin Generating the Trac cgi-bin directory], your Apache configuration file should look like following:85 If you followed the directions [TracInstall#cgi-bin Generating the Trac cgi-bin directory], your Apache configuration file should look like following: 76 86 77 87 {{{ … … 171 181 172 182 For multiple environments, you can use the same `LocationMatch` as described with the previous method. 183 184 '''Note: `Location` cannot be used inside .htaccess files, but must instead live within the main httpd.conf file. If you are on a shared server, you therefore will not be able to provide this level of granularity. ''' 173 185 174 186 Don't forget to activate the mod_auth_digest. For example, on a Debian 4.0r1 (etch) system: … … 308 320 </Location> 309 321 }}} 310 Note that '''authFile''' need not exist . See the !HttpAuthStore link above for examples where multiple Trac projects are hosted on a server.322 Note that '''authFile''' need not exist (unless you are using Account Manager older than 0.4). See the !HttpAuthStore link above for examples where multiple Trac projects are hosted on a server. 311 323 312 324 === Example: Apache/mod_wsgi with Basic Authentication, Trac being at the root of a virtual host … … 360 372 ''Note: using mod_wsgi 2.5 and Python 2.6.1 gave an Internal Server Error on my system (Apache 2.2.11 and Trac 0.11.2.1). Upgrading to Python 2.6.2 (as suggested [http://www.mail-archive.com/modwsgi@googlegroups.com/msg01917.html here]) solved this for me[[BR]]-- Graham Shanks'' 361 373 374 If you plan to use `mod_wsgi` in embedded mode on Windows or with the MPM worker on Linux, then you'll even need version 0.3.4 or greater (see [trac:#10675] for details). 375 362 376 === Getting Trac to work nicely with SSPI and 'Require Group' === 363 377 If like me you've set Trac up on Apache, Win32 and configured SSPI, but added a 'Require group' option to your apache configuration, then the SSPIOmitDomain option is probably not working. If its not working your usernames in trac are probably looking like 'DOMAIN\user' rather than 'user'. … … 386 400 But it's not necessary to edit the source of Trac, the following lines in `trac.wsgi` will also work: 387 401 388 {{{ 402 {{{#!python 389 403 import trac.db.postgres_backend 390 404 trac.db.postgres_backend.PostgreSQLConnection.poolable = False 391 405 }}} 392 406 407 or 408 409 {{{#!python 410 import trac.db.mysql_backend 411 trac.db.mysql_backend.MySQLConnection.poolable = False 412 }}} 413 393 414 Now Trac drops the connection after serving a page and the connection count on the database will be kept minimal. 394 415 … … 397 418 === Other resources 398 419 399 For more troubleshooting tips, see also the [TracModPython#Troubleshooting mod_python troubleshooting] section, as most Apache-related issues are quite similar, plus discussion of potential [http://code.google.com/p/modwsgi/wiki/ApplicationIssues application issues] when using mod_wsgi. 420 For more troubleshooting tips, see also the [TracModPython#Troubleshooting mod_python troubleshooting] section, as most Apache-related issues are quite similar, plus discussion of potential [http://code.google.com/p/modwsgi/wiki/ApplicationIssues application issues] when using mod_wsgi. The wsgi page also has a [http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac Integration With Trac] document. 400 421 401 422