Forum: Ruby on Rails problems with lighty on linux

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1ed4bbef573bfc014d32356d53103ca2?d=identicon&s=25 phil swenson (Guest)
on 2005-12-28 17:35
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"
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 Jamis Buck (Guest)
on 2005-12-28 18:30
(Received via mailing list)
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
1ed4bbef573bfc014d32356d53103ca2?d=identicon&s=25 phil swenson (Guest)
on 2005-12-28 18:51
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 Buck 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
1ed4bbef573bfc014d32356d53103ca2?d=identicon&s=25 phil swenson (Guest)
on 2005-12-28 18:55
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 Buck 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
This topic is locked and can not be replied to.