2 # Load the modules that we need
16 # Basic server configuration
18 server.username = "www-data"
19 server.groupname = "www-data"
20 server.pid-file = "/var/run/lighttpd.pid"
25 accesslog.filename = "/var/log/lighttpd/access.log"
26 server.errorlog = "/var/log/lighttpd/error.log"
29 # Allow munin to monitor the server's status
31 $HTTP["remoteip"] == "127.0.0.1" { status.status-url = "/server-status" }
34 # Fail any attempt to access old versions of the API without
35 # getting rails involved at all
37 $HTTP["url"] =~ "^/api/0.3/" { url.access-deny = ("") }
38 $HTTP["url"] =~ "^/api/0.4/" { url.access-deny = ("") }
41 # IP blocked at SteveC's request as it was trying to download the
42 # history of every object in the database one at a time
44 $HTTP["remoteip"] == "143.210.16.160" { url.access-deny = ("") }
47 # Rule to block tilesAtHome when somebody decides to queue vast
48 # number of tiles for rerendering
50 #$HTTP["useragent"] == "tilesAtHome" { url.access-deny = ("") }
53 # Limit connections to 20 per IP address
55 evasive.max-conns-per-ip = 20
58 # Setup MIME type mapping
62 ".gif" => "image/gif",
63 ".html" => "text/html",
64 ".js" => "application/x-javascript",
65 ".png" => "image/png",
66 ".swf" => "application/x-shockwave-flash",
67 ".txt" => "text/plain"
71 # Enable compression of appropriate static content
74 "application/x-javascript",
75 "application/x-shockwave-flash",
82 # Cache compressed content
84 compress.cache-dir = "/var/cache/lighttpd"
87 # Redirect trac and wiki requests to the right places
90 "^/trac/(.*)$" => "http://trac.openstreetmap.org/$1",
91 "^/wiki/(.*)$" => "http://wiki.openstreetmap.org/$1"
95 # Run anything with a .pl iextension as a CGI script
97 cgi.assign = ( ".pl" => "/usr/bin/perl" )
100 # Serve static content from the rails public area ourselves
102 server.document-root = "/var/www/rails/public"
105 # Send everything else to the appropriate FastCGI server
107 server.error-handler-404 = "/dispatch.fcgi"
108 $HTTP["url"] =~ "^/api/" { server.error-handler-404 = "/dispatch.api" }
111 # Configure the FastCGI servers
115 ( "host" => "127.0.0.1", "port" => 8000, "check-local" => "disable" ),
116 ( "host" => "127.0.0.1", "port" => 8001, "check-local" => "disable" ),
117 ( "host" => "127.0.0.1", "port" => 8002, "check-local" => "disable" ),
118 ( "host" => "127.0.0.1", "port" => 8003, "check-local" => "disable" ),
119 ( "host" => "127.0.0.1", "port" => 8004, "check-local" => "disable" ),
120 ( "host" => "127.0.0.1", "port" => 8005, "check-local" => "disable" )
123 ( "host" => "127.0.0.1", "port" => 8006, "check-local" => "disable" ),
124 ( "host" => "127.0.0.1", "port" => 8007, "check-local" => "disable" ),
125 ( "host" => "127.0.0.1", "port" => 8008, "check-local" => "disable" )