Changes between Version 1 and Version 2 of TracCgi
- Timestamp:
- 12/24/20 01:28:07 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracCgi
v1 v2 11 11 == Apache web-server configuration 12 12 13 In [http ://httpd.apache.org/ Apache] there are two ways to run Trac as CGI:13 In [https://httpd.apache.org/ Apache] there are two ways to run Trac as CGI: 14 14 15 15 1. Use a `ScriptAlias` directive that maps a URL to the `trac.cgi` script (recommended) … … 49 49 }}} 50 50 51 If you are using the [http ://httpd.apache.org/docs/suexec.html Apache suEXEC] feature please see [trac:ApacheSuexec].51 If you are using the [https://httpd.apache.org/docs/suexec.html Apache suEXEC] feature please see [trac:ApacheSuexec]. 52 52 53 53 On some systems, you ''may'' need to edit the shebang line in the `trac.cgi` file to point to your real Python installation path. On a Windows system you may need to configure Windows to know how to execute a `.cgi` file (Explorer -> Tools -> Folder Options -> File Types -> CGI). 54 54 55 === Python Egg Cache 56 57 The [TracInstall#egg-cache egg-cache] can be configured using an `os.environ` statement in `trac.cgi`, as shown above. 58 To do the same from the Apache configuration, use the `SetEnv` directive: 59 {{{#!apache 60 SetEnv PYTHON_EGG_CACHE /path/to/dir 61 }}} 62 63 Put this directive next to where you set the path to the [TracEnvironment Trac environment], i.e. in the same `<Location>` block. 64 65 {{{#!apache 66 <Location /trac> 67 SetEnv TRAC_ENV /path/to/projenv 68 SetEnv PYTHON_EGG_CACHE /path/to/dir 69 </Location> 70 }}} 71 72 73 55 74 === Using WSGI 56 75 57 You can run a [http://henry.precheur.org/python/how_to_serve_cgi WSGI handler] [http ://pythonweb.org/projects/webmodules/doc/0.5.3/html_multipage/lib/example-webserver-web-wsgi-simple-cgi.html under CGI]. You can [wiki:TracModWSGI#Thetrac.wsgiscript write your own application function], or use the deployed trac.wsgi's application.76 You can run a [http://henry.precheur.org/python/how_to_serve_cgi WSGI handler] [https://thejimmyg.github.io/pythonweb/projects/webmodules/doc/0.5.3/html_multipage/lib/example-webserver-web-wsgi-simple-cgi.html under CGI]. You can [wiki:TracModWSGI#Thetrac.wsgiscript write your own application function], or use the deployed trac.wsgi's application. 58 77 59 78 == Mapping Static Resources