Changes between Version 1 and Version 2 of TracFastCgi
- Timestamp:
- Jul 12, 2015, 6:51:25 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracFastCgi
v1 v2 1 [[PageOutline]]2 3 1 = Trac with FastCGI = 2 [[TracGuideToc]] 3 [[PageOutline(2-5, Contents, floated)]] 4 4 5 5 [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. … … 67 67 A better method to specify path to Trac environment is to embed the path 68 68 into `trac.fcgi` script itself. That doesn't require configuration of server 69 environment variables, works for both FastCgimodules69 environment variables, works for both [trac:FastCgi] modules 70 70 (and for [http://www.lighttpd.net/ lighttpd] and CGI as well): 71 71 {{{ … … 371 371 372 372 1. Nginx configuration with basic authentication handled by Nginx - confirmed to work on 0.6.32 373 {{{373 {{{ 374 374 server { 375 375 listen 10.9.8.7:443; … … 386 386 ssl_prefer_server_ciphers on; 387 387 388 # (Or ``^/some/prefix/(.*)``.389 if ($uri ~ ^/(.*)) {390 set $path_info/$1;388 # it makes sense to serve static resources through Nginx (or ``~ [/some/prefix]/chrome/(.*)``) 389 location ~ /chrome/(.*) { 390 alias /home/trac/instance/static/htdocs/$1; 391 391 } 392 392 393 # it makes sense to serve static resources through Nginx 394 location /chrome/ { 395 alias /home/trac/instance/static/htdocs/; 396 } 397 398 # You can copy this whole location to ``location [/some/prefix]/login`` 393 # You can copy this whole location to ``location [/some/prefix](/login)`` 399 394 # and remove the auth entries below if you want Trac to enforce 400 395 # authorization where appropriate instead of needing to authenticate 401 396 # for accessing the whole site. 402 # (Or `` location /some/prefix``.)403 location /{397 # (Or ``~ location /some/prefix(/.*)``.) 398 location ~ (/.*) { 404 399 auth_basic "trac realm"; 405 400 auth_basic_user_file /home/trac/htpasswd; … … 415 410 # (Or ``fastcgi_param SCRIPT_NAME /some/prefix``.) 416 411 fastcgi_param SCRIPT_NAME ""; 417 fastcgi_param PATH_INFO $ path_info;412 fastcgi_param PATH_INFO $1; 418 413 419 414 ## WSGI NEEDED VARIABLES - trac warns about them … … 438 433 } 439 434 }}} 440 441 2. Modified trac.fcgi: 442 443 {{{ 435 1. Modified trac.fcgi: 436 {{{ 444 437 #!/usr/bin/env python 445 438 import os … … 472 465 473 466 }}} 474 475 3. reload nginx and launch trac.fcgi like that: 476 477 {{{ 467 1. reload nginx and launch trac.fcgi like that: 468 {{{#!sh 478 469 trac@trac.example ~ $ ./trac-standalone-fcgi.py 479 470 }}}