|
![]() |
Lighttpd ConfigurationYou’ll need to tell lighttpd how to connect to your SCGI server. The nice thing
is that the Make sure you have mod_scgi mentioned in the modules:
Tell lighttpd to route 404 errors to your SCGI server with this stupidity:
Next you have to tell lighttpd to route all requests for dispatch.scgi to SCGI and not to check for local. scgi.server = ( "dispatch.scgi" => (( "host" => "127.0.0.1", "port" => 9999, "check-local" => "disable" )) ) What happens is lighttpd will check for a request in /public as a file, it doesn’t find a file so it runs the 404 handler. You’ve got /dispatch.scgi as the 404 handler, which is configured to then run 127.0.0.1:9999 SCGI server, which has check-local disabled. Then the bump on the frog on the log at the bottom of the ocean by the beach with the man with the tan will begin to work. Oh well, it’s much better than Apache’s configuration at least. Then I turn on super debugging for fun:
But make sure you turn this off in production. A common complaint people have is that lighttpd spams the lighttpd_error.log file with tons of connection messages and other stuff if debug=3. Set it to scgi.debug=0 for better messages in production.
Cluster ConfigurationConfiguring a cluster under lighttpd is pretty easy. Here’s what I do:
scgi.server = ( "dispatch.scgi" =>
(
"server1" =>
( "host" => "127.0.0.1",
"port" => 9999,
"check-local" => "disable"),
"server2" =>
( "host" => "127.0.0.1",
"port" => 10000,
"check-local" => "disable"),
"server3" =>
( "host" => "127.0.0.1",
"port" => 10001,
"check-local" => "disable")
)
)
This sets up three backends to handle the requests, with the first one getting the majority of the requests. You can even put these on different machines and set them up however you like. |