close Warning: Can't synchronize with repository "(default)" (/var/svn/mioproject does not appear to be a Subversion repository.). Look in the Trac log for more information.

Changes between Version 1 and Version 2 of TracFastCgi


Ignore:
Timestamp:
Jul 6, 2009, 10:44:11 PM (15 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracFastCgi

    v1 v2  
    7272== Simple Cherokee Configuration ==
    7373
    74 Configuration wanted.
     74The configuration on Cherokee's side is quite simple. You will only need to know that you can spawn Trac as an SCGI process.
     75You can either start it manually, or better yet, automatically by letting Cherokee spawn the server whenever it is down.
     76First set up an information source in cherokee-admin with a local interpreter.
     77
     78{{{
     79Host:
     80localhost:4433
     81
     82Interpreter:
     83/usr/bin/tracd —single-env —daemonize —protocol=scgi —hostname=localhost —port=4433 /path/to/project/
     84}}}
     85
     86If 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''.
     87
     88After 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.
     89The 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/''
    7590
    7691== 単純な Lighttpd の設定 == #SimpleLighttpdConfiguration
     
    327342=== Simple Nginx Configuration ===
    328343
    329 1) Nginx configuration snippet - confirmed to work on 0.5.36
     3441) Nginx configuration snippet - confirmed to work on 0.6.32
    330345{{{
    331346    server {
     
    343358        ssl_prefer_server_ciphers   on;
    344359
     360        # (Or ``^/some/prefix/(.*)``.
     361        if ($uri ~ ^/(.*)) {
     362             set $path_info /$1;
     363        }
     364
     365        # You can copy this whole location to ``location [/some/prefix]/login``
     366        # and remove the auth entries below if you want Trac to enforce
     367        # authorization where appropriate instead of needing to authenticate
     368        # for accessing the whole site.
     369        # (Or ``location /some/prefix``.)
    345370        location / {
    346371            auth_basic            "trac realm";
    347372            auth_basic_user_file /home/trac/htpasswd;
    348373
    349             # full path
    350             if ($uri ~ ^/([^/]+)(/.*)) {
    351                  set $script_name $1;
    352                  set $path_info $2;
    353             }
    354 
    355             # index redirect
    356             if ($uri ~ ^/([^/]+)$) {
    357                  rewrite (.+) $1/ permanent;
    358             }
    359          
    360374            # socket address
    361375            fastcgi_pass   unix:/home/trac/run/instance.sock;
     
    365379
    366380            ## WSGI REQUIRED VARIABLES
    367             # WSGI application name - trac instance prefix.
    368             fastcgi_param  SCRIPT_NAME        /$script_name;
     381            # WSGI application name - trac instance prefix.
     382            # (Or ``fastcgi_param  SCRIPT_NAME  /some/prefix``.)
     383            fastcgi_param  SCRIPT_NAME        "";
    369384            fastcgi_param  PATH_INFO          $path_info;
    370385
     
    376391
    377392            # for authentication to work
     393            fastcgi_param  AUTH_USER          $remote_user;
    378394            fastcgi_param  REMOTE_USER        $remote_user;
    379395        }
     
    437453
    438454----
    439 See also TracCgi, TracModPython, TracInstall, TracGuide, [http://trac.edgewall.org/wiki/TracNginxRecipe TracNginxRecipe]
     455See also:  TracGuide, TracInstall, [wiki:TracModWSGI ModWSGI], [wiki:TracCgi CGI], [wiki:TracModPython ModPython], [http://trac.edgewall.org/wiki/TracNginxRecipe TracNginxRecipe]