Problems with lighty on linux

I’m trying to get our app running on Lighty… I followed Ezra’s
instructions: http://brainspl.at/pages/rails_stack… Currently the app
runs fine with webrick, but with lighty I get 404 errors on everything.
I found if I don’t edit the lighttpd.conf file to use absolute paths, it
works fine. But this is not good for production because I need to run it
with the -d param to run as a daemon. Even on the ruby default page I
click on the “About your applicationâ??s environment” link I get a 404.

Here’s the lighttpd conf file:

Default configuration file for the lighttpd web server

Start using ./script/server lighttpd

server.port = 3001

server.modules = ( “mod_rewrite”, “mod_accesslog”,
“mod_fastcgi” )
server.error-handler-404 =
“/ci/htdocs/ci/rails/external/public/dispatch.fcgi”
server.document-root = “/ci/htdocs/ci/rails/external/public/”

server.errorlog =
“/ci/htdocs/ci/rails/external/log/lighttpd.error.log”
accesslog.filename =
“/ci/htdocs/ci/rails/external/log/lighttpd.access.log”

url.rewrite = ( “^/$” => “index.html”, “^([^.]+)$” =>
“$1.html” )

Change *-procs to 2 if you need to use Upload Progress or other tasks

that

need to execute a second request while the first is still pending.

fastcgi.server = ( “.fcgi” =>
( “localhost” =>
(
“min-procs” => 1,
“max-procs” => 1,
“socket” => “/ci/htdocs/ci/rails/external/log/fcgi.socket”,
“bin-path” =>
“/ci/htdocs/ci/rails/external/public/dispatch.fcgi”,
“bin-environment” => ( “RAILS_ENV” => “development” )
)
)
)
mimetype.assign = (
“.css” => “text/css”,
“.gif” => “image/gif”,
“.htm” => “text/html”,
“.html” => “text/html”,
“.jpeg” => “image/jpeg”,
“.jpg” => “image/jpeg”,
“.js” => “text/javascript”,
“.png” => “image/png”,
“.swf” => “application/x-shockwave-flash”,
“.txt” => “text/plain”

On Dec 28, 2005, at 9:35 AM, phil swenson wrote:

click on the “About your application?s environment” link I get a 404.
server.error-handler-404 =
“/ci/htdocs/ci/rails/external/public/dispatch.fcgi”
server.document-root = “/ci/htdocs/ci/rails/external/public/”

The error-handler-404 needs to be (according to http://lighttpd.net/
documentation/configuration.html) the “uri to call if the requested
file results in a 404”. Thus, it should be specified relative to the
document-root, e.g. “/dispatch.fcgi”. You might try that and see if
that works any better.

  • Jamis

THe problem is I shouldn’t be getting a 404 error at all, I have
content, controllers, views etc which all give me 404s. If I run
lighttpd without relational paths it works fine. Something is
misconfigured…

Jamis B. wrote:

On Dec 28, 2005, at 9:35 AM, phil swenson wrote:

click on the “About your application�s environment” link I get a 404.
server.error-handler-404 =
“/ci/htdocs/ci/rails/external/public/dispatch.fcgi”
server.document-root = “/ci/htdocs/ci/rails/external/public/”

The error-handler-404 needs to be (according to http://lighttpd.net/
documentation/configuration.html) the “uri to call if the requested
file results in a 404”. Thus, it should be specified relative to the
document-root, e.g. “/dispatch.fcgi”. You might try that and see if
that works any better.

  • Jamis

I take it back. This solved the problem! Thanks very much!

phil swenson wrote:

THe problem is I shouldn’t be getting a 404 error at all, I have
content, controllers, views etc which all give me 404s. If I run
lighttpd without relational paths it works fine. Something is
misconfigured…

Jamis B. wrote:

On Dec 28, 2005, at 9:35 AM, phil swenson wrote:

click on the “About your application�s environment” link I get a 404.
server.error-handler-404 =
“/ci/htdocs/ci/rails/external/public/dispatch.fcgi”
server.document-root = “/ci/htdocs/ci/rails/external/public/”

The error-handler-404 needs to be (according to http://lighttpd.net/
documentation/configuration.html) the “uri to call if the requested
file results in a 404”. Thus, it should be specified relative to the
document-root, e.g. “/dispatch.fcgi”. You might try that and see if
that works any better.

  • Jamis