Changes between Version 3 and Version 4 of TracFastCgi


Ignore:
Timestamp:
20/07/2009 15:23:49 (15 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracFastCgi

    v3 v4  
    7171== Simple Cherokee Configuration ==
    7272
    73 Configuration wanted.
     73The configuration on Cherokee's side is quite simple. You will only need to know that you can spawn Trac as an SCGI process.
     74You can either start it manually, or better yet, automatically by letting Cherokee spawn the server whenever it is down.
     75First set up an information source in cherokee-admin with a local interpreter.
     76
     77{{{
     78Host:
     79localhost:4433
     80
     81Interpreter:
     82/usr/bin/tracd —single-env —daemonize —protocol=scgi —hostname=localhost —port=4433 /path/to/project/
     83}}}
     84
     85If the port was not reachable, the interpreter command would be launched. Note that, in the definition of the information source, you will have to manually launch the spawner if you use a ''Remote host'' as ''Information source'' instead of a ''Local interpreter''.
     86
     87After doing this, we will just have to create a new rule managed by the SCGI handler to access Trac. It can be created in a new virtual server, trac.example.net for instance, and will only need two rules. The '''default''' one will use the SCGI handler associated to the previously created information source.
     88The second rule will be there to serve the few static files needed to correctly display the Trac interface. Create it as ''Directory rule'' for ''/chrome/common'' and just set it to the ''Static files'' handler and with a ''Document root'' that points to the appropriate files: ''/usr/share/trac/htdocs/''
    7489
    7590== Simple Lighttpd Configuration ==
     
    325340=== Simple Nginx Configuration ===
    326341
    327 1) Nginx configuration snippet - confirmed to work on 0.5.36
     3421) Nginx configuration snippet - confirmed to work on 0.6.32
    328343{{{
    329344    server {
     
    341356        ssl_prefer_server_ciphers   on;
    342357
     358        # (Or ``^/some/prefix/(.*)``.
     359        if ($uri ~ ^/(.*)) {
     360             set $path_info /$1;
     361        }
     362
     363        # You can copy this whole location to ``location [/some/prefix]/login``
     364        # and remove the auth entries below if you want Trac to enforce
     365        # authorization where appropriate instead of needing to authenticate
     366        # for accessing the whole site.
     367        # (Or ``location /some/prefix``.)
    343368        location / {
    344369            auth_basic            "trac realm";
    345370            auth_basic_user_file /home/trac/htpasswd;
    346371
    347             # full path
    348             if ($uri ~ ^/([^/]+)(/.*)) {
    349                  set $script_name $1;
    350                  set $path_info $2;
    351             }
    352 
    353             # index redirect
    354             if ($uri ~ ^/([^/]+)$) {
    355                  rewrite (.+) $1/ permanent;
    356             }
    357          
    358372            # socket address
    359373            fastcgi_pass   unix:/home/trac/run/instance.sock;
     
    363377
    364378            ## WSGI REQUIRED VARIABLES
    365             # WSGI application name - trac instance prefix.
    366             fastcgi_param  SCRIPT_NAME        /$script_name;
     379            # WSGI application name - trac instance prefix.
     380            # (Or ``fastcgi_param  SCRIPT_NAME  /some/prefix``.)
     381            fastcgi_param  SCRIPT_NAME        "";
    367382            fastcgi_param  PATH_INFO          $path_info;
    368383
     
    374389
    375390            # for authentication to work
     391            fastcgi_param  AUTH_USER          $remote_user;
    376392            fastcgi_param  REMOTE_USER        $remote_user;
    377393        }
     
    435451
    436452----
    437 See also TracCgi, TracModPython, TracInstall, TracGuide, [trac:TracNginxRecipe TracNginxRecipe]
     453See also:  TracGuide, TracInstall, [wiki:TracModWSGI ModWSGI], [wiki:TracCgi CGI], [wiki:TracModPython ModPython], [trac:TracNginxRecipe TracNginxRecipe]