Edgewall Software

Changes between Version 42 and Version 43 of TracFastCgi


Ignore:
Timestamp:
May 14, 2008, 11:17:05 AM (16 years ago)
Author:
screwdriver@…
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TracFastCgi

    v42 v43  
    387387{{{
    388388#!/usr/bin/env python
    389 
     389import os
    390390sockaddr = '/home/trac/run/instance.sock'
     391os.environ['TRAC_ENV'] = '/home/trac/instance'
    391392
    392393try:
     
    394395     import trac.web._fcgi
    395396
    396      fcgiserv = trac.web._fcgi.WSGIServer(dispatch_request, bindAddress = sockaddr)
     397     fcgiserv = trac.web._fcgi.WSGIServer(dispatch_request,
     398          bindAddress = sockaddr, umask = 7)
    397399     fcgiserv.run()
    398400
     
    418420
    419421{{{
    420 trac@trac.example ~ $ TRAC_ENV=/home/trac/instance ./trac-standalone-fcgi.py
     422trac@trac.example ~ $ ./trac-standalone-fcgi.py
    421423}}}
    422424
    423425The above assumes that:
    424  * There is a user trac for running trac instances and keeping trac environments in its home directory.
     426 * There is a user named 'trac' for running trac instances and keeping trac environments in its home directory.
    425427 * /home/trac/instance contains a trac environment
    426428 * /home/trac/htpasswd contains authentication information
    427 
    428 You may have to chmod the unix socket file so that nginx can connect to it. Check this if you keep getting 502 errors.
    429 
    430 Unfortunately nginx does not support variable expansion in fastcgi_pass directive, thus it is not possible to serve multiple trac instances from one server block.
     429 * /home/trac/run is owned by the same group the nginx runs under
     430  * and if your system is Linux the /home/trac/run has setgid bit set (chmod g+s run)
     431  * and patch from ticket #7239 is applied, or you'll have to fix the socket file permissions every time
     432
     433Unfortunately nginx does not support variable expansion in fastcgi_pass directive.
     434Thus it is not possible to serve multiple trac instances from one server block.
    431435
    432436If you worry enough about security, run trac instances under separate users.