Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 3 and Version 4 of LighttpdIntegration


Ignore:
Timestamp:
11/12/05 03:03:26 (9 years ago)
Author:
william
Comment:

add an improved lighhtpd rules to server tg applications

Legend:

Unmodified
Added
Removed
Modified
  • LighttpdIntegration

    v3 v4  
    33I have '''not''' yet tested this, so be aware that it could be completely wrong. Please modify it if it's incorrect or if you just have improvements to suggest. 
    44 
     5== 1. Simple proxy == 
    56In the [http://groups.google.com/group/turbogears/browse_frm/thread/3fe6f4b79f0eee4c/ thread titled "lighttpd, Anyone?"], Elvelind Grandin posted his sample configuration for using lighttpd with TurboGears: 
    67 
     
    1920In this example, TurboGears is running on port 1082, and lighttpd is running on port 80. Any HTTP request that comes in for the foo.org server is proxied to localhost:1082, and thus served up by TurboGears. Presumably (although I haven't tried this), you could let lighttpd serve up static pages by putting them in a different subdomain like "css.foo.org" or "images.foo.org". I'm sure there are also other configurations that could be tried -- perhaps someone will post them. 
    2021 
     22== 2. via SCGI == 
    2123It's also possible to run under SCGI using lighttpd using this [http://www.cherrypy.org/wiki/ScgiWsgi CherryPy recipe] and a matching config for lighttpd. 
    2224 
    2325See also [http://cleverdevil.org/computing/34/ this blog post] on running TurboGears under lighttpd/WSGI/SCGI. 
     26 
     27== 3. Improved Simple Proxy == 
     28 
     29{{{ 
     30$HTTP["host"] == "foo.org" { 
     31    server.document-root = "/path/to/your/foo-tg-project/" 
     32 
     33    $HTTP["url"] !~ "^/static" { 
     34 
     35        proxy.server = ( "" => ( 
     36                        ( 
     37                                "host" => "127.0.0.1", 
     38                                "port" => 1082 
     39                                ) 
     40                        ) 
     41        ) 
     42} 
     43}}} 
     44 
     45This rule will allow you to server all static files directly via Lighttpd. This way you can profit from both tools: lighttpd for his performance to serve static files and Turbogears for all dynamic elements. 
     46 
     47This rule has the advantage that nothing must be changed into the Turobgears config files. 
     48 
     49This rule has been tested and is implemented on my servers (william)