Changes between Version 1 and Version 2 of TracFastCgi


Ignore:
Timestamp:
Jul 13, 2010, 7:13:29 PM (14 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracFastCgi

    v1 v2  
    4545 
    4646To setup Trac environment for `mod_fcgid` it is necessary to use 
    47 `FCGIDDefaultInitEnv` directive. It cannot be used in `Directory` or 
     47`DefaultInitEnv` directive. It cannot be used in `Directory` or 
    4848`Location` context, so if you need to support multiple projects, try 
    4949alternative environment setup below. 
    5050 
    5151{{{ 
    52 FCGIDDefaultInitEnv TRAC_ENV /path/to/env/trac/ 
     52DefaultInitEnv TRAC_ENV /path/to/env/trac/ 
    5353}}} 
    5454 
     
    122122and you may set one of the two in `trac.fcgi` instead of in `lighttpd.conf` 
    123123using `bin-environment` (as in the section above on Apache configuration). 
     124 
     125Note 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. 
    124126 
    125127For using two projects with lighttpd add the following to your `lighttpd.conf`: 
     
    275277Note about running lighttpd with reduced permissions: 
    276278 
    277   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. 
     279  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. 
    278280 
    279281 
     
    284286!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. 
    285287 
    286 Setup 
    287  
    288 1) Please make sure you have first have a working install of a Trac project. Test install with “tracd” first. 
    289  
    290 2) Create a Virtual Host for this setup. From now on we will refer to this vhost as TracVhost. For this tutorial we will be assuming that your trac project will be accessible via: 
     288=== Setup === 
     289 
     290 1. Please make sure you have first have a working install of a Trac project. Test install with “tracd” first. 
     291 
     292 2. Create a Virtual Host for this setup. From now on we will refer to this vhost as !TracVhost. For this tutorial we will be assuming that your trac project will be accessible via: 
    291293 
    292294{{{ 
     
    294296}}} 
    295297 
    296 3) Go “TracVhost → External Apps” tab and create a new “External Application”. 
     298 3. Go “!TracVhost → External Apps” tab and create a new “External Application”. 
    297299 
    298300{{{ 
     
    312314}}} 
    313315 
    314 4) Optional. If you need to use htpasswd based authentication. Go to “TracVhost → Security” tab and create a new security “Realm”. 
     316 4. Optional. If you need to use htpasswd based authentication. Go to “!TracVhost → Security” tab and create a new security “Realm”. 
    315317 
    316318{{{ 
     
    322324If you don’t have a htpasswd file or don’t know how to create the entries within one, go to http://sherylcanter.com/encrypt.php, to generate the user:password combos. 
    323325 
    324 5) Go to “PythonVhost → Contexts” and create a new “FCGI Context”. 
     326 5. Go to “!PythonVhost → Contexts” and create a new “FCGI Context”. 
    325327 
    326328{{{ 
     
    330332}}} 
    331333 
    332 6) Modify /fullpathto/mytracproject/conf/trac.ini 
     334 6. Modify `/fullpathto/mytracproject/conf/trac.ini` 
    333335 
    334336{{{ 
     
    339341}}} 
    340342 
    341 7) Restart !LiteSpeed, “lswsctrl restart”, and access your new Trac project at:  
     343 7. Restart !LiteSpeed, “lswsctrl restart”, and access your new Trac project at:  
    342344 
    343345{{{ 
     
    345347}}} 
    346348 
    347 === Simple Nginx Configuration === 
    348  
    349 1) Nginx configuration snippet - confirmed to work on 0.6.32 
     349== Simple Nginx Configuration == 
     350 
     351 1. Nginx configuration snippet - confirmed to work on 0.6.32 
    350352{{{ 
    351353    server { 
     
    394396            fastcgi_param  SERVER_PORT        $server_port; 
    395397            fastcgi_param  SERVER_PROTOCOL    $server_protocol; 
     398            fastcgi_param  QUERY_STRING     $query_string; 
    396399 
    397400            # for authentication to work 
     
    402405}}} 
    403406 
    404 2) Modified trac.fcgi: 
     407 2. Modified trac.fcgi: 
    405408 
    406409{{{ 
     
    436439}}} 
    437440 
    438 3) reload nginx and launch trac.fcgi like that: 
     441 3. reload nginx and launch trac.fcgi like that: 
    439442 
    440443{{{ 
     
    444447The above assumes that: 
    445448 * There is a user named 'trac' for running trac instances and keeping trac environments in its home directory. 
    446  * /home/trac/instance contains a trac environment 
    447  * /home/trac/htpasswd contains authentication information 
    448  * /home/trac/run is owned by the same group the nginx runs under 
    449   * and if your system is Linux the /home/trac/run has setgid bit set (chmod g+s run) 
     449 * `/home/trac/instance` contains a trac environment 
     450 * `/home/trac/htpasswd` contains authentication information 
     451 * `/home/trac/run` is owned by the same group the nginx runs under 
     452  * and if your system is Linux the `/home/trac/run` has setgid bit set (`chmod g+s run`) 
    450453  * and patch from ticket #T7239 is applied, or you'll have to fix the socket file permissions every time 
    451454