2 # Load the modules that we need
14 # Basic server configuration
16 server.username = "www-data"
17 server.groupname = "www-data"
18 server.pid-file = "/var/run/lighttpd.pid"
23 accesslog.filename = "/var/log/lighttpd/access.log"
24 server.errorlog = "/var/log/lighttpd/error.log"
27 # Allow munin to monitor the server's status
29 $HTTP["remoteip"] == "127.0.0.1" { status.status-url = "/server-status" }
32 # API 0.3 is long dead, so fail any attempt to access it without
33 # getting rails involved at all
35 $HTTP["url"] =~ "^/api/0.3/" { url.access-deny = ("") }
38 # IP blocked at SteveC's request as it was trying to download the
39 # history of every object in the database one at a time
41 $HTTP["remoteip"] == "143.210.16.160" { url.access-deny = ("") }
44 # Limit connections to 20 per IP address
46 evasive.max-conns-per-ip = 20
49 # Setup MIME type mapping
53 ".gif" => "image/gif",
54 ".html" => "text/html",
55 ".js" => "application/x-javascript",
56 ".png" => "image/png",
57 ".swf" => "application/x-shockwave-flash",
58 ".txt" => "text/plain"
62 # Enable compression of appropriate static content
65 "application/x-javascript",
66 "application/x-shockwave-flash",
73 # Cache compressed content
75 compress.cache-dir = "/var/cache/lighttpd"
78 # Serve static content from the rails public area ourselves
80 server.document-root = "/var/www/rails/public"
83 # Send everything else to the appropriate FastCGI server
85 server.error-handler-404 = "/dispatch.fcgi"
86 $HTTP["url"] =~ "^/api/" { server.error-handler-404 = "/dispatch.api" }
89 # Configure the FastCGI servers
93 ( "host" => "127.0.0.1", "port" => 8000, "check-local" => "disable" ),
94 ( "host" => "127.0.0.1", "port" => 8001, "check-local" => "disable" ),
95 ( "host" => "127.0.0.1", "port" => 8002, "check-local" => "disable" ),
96 ( "host" => "127.0.0.1", "port" => 8003, "check-local" => "disable" ),
97 ( "host" => "127.0.0.1", "port" => 8004, "check-local" => "disable" ),
98 ( "host" => "127.0.0.1", "port" => 8005, "check-local" => "disable" )
101 ( "host" => "127.0.0.1", "port" => 8006, "check-local" => "disable" ),
102 ( "host" => "127.0.0.1", "port" => 8007, "check-local" => "disable" ),
103 ( "host" => "127.0.0.1", "port" => 8008, "check-local" => "disable" )