]> git.openstreetmap.org Git - rails.git/blob - config/lighttpd.conf
preliminary commit 0.5 API with relations / untested after entity-relation rename...
[rails.git] / config / lighttpd.conf
1 #
2 # Load the modules that we need
3 #
4 server.modules = ( 
5   "mod_access",
6   "mod_accesslog",
7   "mod_cgi",
8   "mod_compress",
9   "mod_evasive",
10   "mod_fastcgi",
11   "mod_redirect",
12   "mod_status"
13 )
14
15 #
16 # Basic server configuration
17 #
18 server.username = "www-data"
19 server.groupname = "www-data"
20 server.pid-file = "/var/run/lighttpd.pid"
21
22 #
23 # Setup logging
24 #
25 accesslog.filename = "/var/log/lighttpd/access.log"
26 server.errorlog = "/var/log/lighttpd/error.log"
27
28 #
29 # Allow munin to monitor the server's status
30 #
31 $HTTP["remoteip"] == "127.0.0.1" { status.status-url = "/server-status" }
32
33 #
34 # API 0.3 is long dead, so fail any attempt to access it without
35 # getting rails involved at all
36 #
37 $HTTP["url"] =~ "^/api/0.3/" { url.access-deny = ("") }
38
39 #
40 # IP blocked at SteveC's request as it was trying to download the
41 # history of every object in the database one at a time
42 #
43 $HTTP["remoteip"] == "143.210.16.160" { url.access-deny = ("") }
44
45 #
46 # Rule to block tilesAtHome when somebody decides to queue vast 
47 # number of tiles for rerendering
48 #
49 #$HTTP["useragent"] == "tilesAtHome" { url.access-deny = ("") }
50
51 #
52 # Limit connections to 20 per IP address
53 #
54 evasive.max-conns-per-ip = 20
55
56 #
57 # Setup MIME type mapping
58 #
59 mimetype.assign = (
60   ".css" => "text/css",
61   ".gif" => "image/gif",
62   ".html" => "text/html",
63   ".js" => "application/x-javascript",
64   ".png" => "image/png",
65   ".swf" => "application/x-shockwave-flash",
66   ".txt" => "text/plain"
67 )
68
69 #
70 # Enable compression of appropriate static content
71 #
72 compress.filetype = ( 
73   "application/x-javascript",
74   "application/x-shockwave-flash",
75   "text/css",
76   "text/html",
77   "text/plain"
78 )
79
80 #
81 # Cache compressed content
82 #
83 compress.cache-dir = "/var/cache/lighttpd"
84
85 #
86 # Redirect trac and wiki requests to the right places
87 #
88 url.redirect = ( 
89   "^/trac/(.*)$" => "http://trac.openstreetmap.org/$1",
90   "^/wiki/(.*)$" => "http://wiki.openstreetmap.org/$1"
91 )
92
93 #
94 # Run anything with a .pl iextension as a CGI script
95 #
96 cgi.assign = ( ".pl" => "/usr/bin/perl" )
97
98 #
99 # Serve static content from the rails public area ourselves
100 #
101 server.document-root = "/var/www/rails/public"
102
103 #
104 # Send everything else to the appropriate FastCGI server
105 #
106 server.error-handler-404 = "/dispatch.fcgi"
107 $HTTP["url"] =~ "^/api/" { server.error-handler-404 = "/dispatch.api" }
108
109 #
110 # Configure the FastCGI servers
111 #
112 fastcgi.server = ( 
113   ".fcgi" => (
114     ( "host" => "127.0.0.1", "port" => 8000, "check-local" => "disable" ),
115     ( "host" => "127.0.0.1", "port" => 8001, "check-local" => "disable" ),
116     ( "host" => "127.0.0.1", "port" => 8002, "check-local" => "disable" ),
117     ( "host" => "127.0.0.1", "port" => 8003, "check-local" => "disable" ),
118     ( "host" => "127.0.0.1", "port" => 8004, "check-local" => "disable" ),
119     ( "host" => "127.0.0.1", "port" => 8005, "check-local" => "disable" )
120   ),
121   ".api" => (
122     ( "host" => "127.0.0.1", "port" => 8006, "check-local" => "disable" ),
123     ( "host" => "127.0.0.1", "port" => 8007, "check-local" => "disable" ),
124     ( "host" => "127.0.0.1", "port" => 8008, "check-local" => "disable" )
125   )
126 )