Edgewall Software

Changes between Version 67 and Version 68 of TracFastCgi


Ignore:
Timestamp:
Feb 27, 2011, 4:23:10 PM (13 years ago)
Author:
Christian Boos
Comment:

a bit of reorganization, some clean-ups

Legend:

Unmodified
Added
Removed
Modified
  • TracFastCgi

    v67 v68  
    11= Trac with FastCGI =
    22
    3 [http://www.fastcgi.com/ FastCGI] interface allows Trac to remain resident much like with [wiki:TracModPython mod_python]. It is faster than external CGI interfaces which must start a new process for each request. However, unlike mod_python, FastCGI supports [http://httpd.apache.org/docs/suexec.html Apache SuEXEC], i.e. run with different permissions than web server. Additionally, it is supported by much wider variety of web servers.
     3[http://www.fastcgi.com/ FastCGI] interface allows Trac to remain resident much like with [wiki:TracModPython mod_python] or [wiki:TracModWSGI mod_wsgi]. It is faster than external CGI interfaces which must start a new process for each request.  Additionally, it is supported by much wider variety of web servers.
     4
     5Note that unlike mod_python, FastCGI supports [http://httpd.apache.org/docs/suexec.html Apache SuEXEC], i.e. run with different permissions than web server running with (`mod_wsgi` supports the `WSGIDaemonProcess` with user / group parameters to achieve the same effect).
    46
    57'''Note for Windows:''' Trac's FastCGI does not run under Windows, as Windows does not implement `Socket.fromfd`, which is used by `_fcgi.py`. If you want to connect to IIS, you may want to try [trac:TracOnWindowsIisAjp AJP].
     8
     9[[PageOutline(2-3,Overview,inline)]]
     10
    611
    712== Simple Apache configuration ==
     
    1015`mod_fcgid` (preferred). The latter is more up-to-date.
    1116
    12 ==== setup with `mod_fastcgi` ====
     17=== setup with `mod_fastcgi` ===
    1318`mod_fastcgi` uses `FastCgiIpcDir` and `FastCgiConfig` directives that should be added to an appropriate Apache configuration file:
    1419{{{
     
    3742}}}
    3843
    39 ==== setup with `mod_fcgid` ====
     44=== setup with `mod_fcgid` ===
    4045Configure `ScriptAlias` (see TracCgi for details), but call `trac.fcgi`
    4146instead of `trac.cgi`. Note that slash at the end - it is important.
     
    5358}}}
    5459
    55 ==== alternative environment setup ====
     60=== alternative environment setup ===
    5661A better method to specify path to Trac environment is to embed the path
    5762into `trac.fcgi` script itself. That doesn't require configuration of server
     
    7681}}}
    7782
     83
    7884== Simple Cherokee Configuration ==
    7985
     
    101107sudo apt-get install python-flup
    102108}}}
     109
    103110
    104111== Simple Lighttpd Configuration ==
     
    130137using `bin-environment` (as in the section above on Apache configuration).
    131138
    132 Note that lighttpd has a bug related to 'SCRIPT_NAME' and 'PATH_INFO' when the uri of fastcgi.server is '/' instead of '/trac' in this example, see #Trac2418. This should be fixed since lighttpd 1.4.23, and you may need to add `"fix-root-scriptname" => "enable"` as parameter of fastcgi.server.
     139Note that lighttpd has a bug related to 'SCRIPT_NAME' and 'PATH_INFO' when the uri of fastcgi.server is '/' instead of '/trac' in this example (see [trac:#2418]). This should be fixed since lighttpd 1.4.23, and you may need to add `"fix-root-scriptname" => "enable"` as parameter of fastcgi.server.
    133140
    134141For using two projects with lighttpd add the following to your `lighttpd.conf`:
     
    159166Note that the above will result in different processes in any event, even
    160167if both are running from the same `trac.fcgi` script.
     168
    161169{{{
    162170#!div class=important
    163171'''Note''' It's very important the order on which server.modules are loaded, if mod_auth is not loaded '''BEFORE''' mod_fastcgi, then the server will fail to authenticate the user.
    164172}}}
     173
    165174For authentication you should enable mod_auth in lighttpd.conf 'server.modules', select auth.backend and auth rules:
    166175{{{
     
    276285For details about languages specification see [trac:TracFaq TracFaq] question 2.13.
    277286
    278 Other important information like [http://trac.lighttpd.net/trac/wiki/TracInstall this updated TracInstall page], [wiki:TracCgi#MappingStaticResources and this] are useful for non-fastcgi specific installation aspects.
    279 
    280 If you use trac-0.9, read [http://lists.edgewall.com/archive/trac/2005-November/005311.html about small bug]
     287Other important information like the [wiki:TracInstall#MappingStaticResources mapping static resources advices] are useful for non-fastcgi specific installation aspects.
     288]
    281289
    282290Relaunch lighttpd, and browse to `http://yourhost.example.org/trac` to access Trac.
     
    284292Note about running lighttpd with reduced permissions:
    285293
    286   If nothing else helps and trac.fcgi doesn't start with lighttpd settings `server.username = "www-data"`, `server.groupname = "www-data"`, then in the `bin-environment` section set `PYTHON_EGG_CACHE` to the home directory of `www-data` or some other directory accessible to this account for writing.
     294If nothing else helps and trac.fcgi doesn't start with lighttpd settings `server.username = "www-data"`, `server.groupname = "www-data"`, then in the `bin-environment` section set `PYTHON_EGG_CACHE` to the home directory of `www-data` or some other directory accessible to this account for writing.
    287295
    288296
     
    292300
    293301!LiteSpeed web server is an event-driven asynchronous Apache replacement designed from the ground-up to be secure, scalable, and operate with minimal resources. !LiteSpeed can operate directly from an Apache config file and is targeted for business-critical environments.
    294 
    295 === Setup ===
    296302
    297303 1. Please make sure you have first have a working install of a Trac project. Test install with “tracd” first.
     
    353359http://yourdomain.com/trac/
    354360}}}
     361
    355362
    356363== Simple Nginx Configuration ==