Forum: Ruby on Rails First try with lighttpd

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.
Peter M. (Guest)
on 2006-05-21 04:24
(Received via mailing list)
Hi,

I have a Rails application sitting on my computer that works just fine
with webrick. I would like to try to serve it locally with lighttpd

I followed the instructions on the hivelogic site for installing
lighttpd

http://hivelogic.com/articles/2005/12/01/ruby_rail...

Then I looked on page 457 in the Agile Rails book for instructions
about configuring the rails app for lighttpd and wrote the config file
at the bottom of this email.

I started the Rails app with "lighttpd -f config/lighttpd.conf".

When I tried to view the site in a browser I saw an unexpected error

   #28000Access denied for user 'root'@'localhost' (using password: NO)

In my database.yml file i am not using root for the mysql user for
either development or production. Does lighttpd not know to look in
database.yml?

Thanks,
Peter



server.port = 80
server.bind = "127.0.0.1"
server.event-handler = "freebsd-kqueue"
server.modules = ( "mod_rewrite", "mod_fastcgi" )
url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
server.error-handler-404 = "/dispatch.fcgi"
server.document-root = "/Users/peter/characters/public"
server.errorlog = "/Users/peter/characters/log/server.log"
fastcgi.server = ( ".fcgi" =>
  ( "localhost" =>
    (
       "min-procs" => 10,
       "max-procs" => 10,
       "socket" => "/tmp/characters.fcgi.socket",
       "bin-path" => "/Users/peter/characters/public/dispatch.fcgi",
       "bin-environment" => ( "RAILS_ENV" => "production" )
    )
  )
)
Peter M. (Guest)
on 2006-05-21 20:35
(Received via mailing list)
Hi,

I've been trying to get just an empty Rails site to work with the
lighttpd config file below. I can't even see the Welcome you're riding
the rails page.

Any ideas what to do?

Thanks,
Peter


On 5/20/06, Peter M. <removed_email_address@domain.invalid> wrote:
> about configuring the rails app for lighttpd and wrote the config file
> database.yml?
>
> Thanks,
> Peter
>
>

server.port = 3000
server.bind = "127.0.0.1"
server.event-handler = "freebsd-kqueue"
server.modules = ( "mod_rewrite", "mod_fastcgi" )
url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
server.error-handler-404 = "/dispatch.fcgi"
server.document-root = "/Users/peter/characters/public"
server.errorlog = "/Users/peter/characters/log/server.log"
fastcgi.server = ( ".fcgi" =>
 ( "localhost" =>
   (
      "min-procs" => 10,
      "max-procs" => 10,
      "socket" => "/tmp/characters.fcgi.socket",
      "bin-path" => "/Users/peter/characters/public/dispatch.fcgi",
      "bin-environment" => ( "RAILS_ENV" => "production" )
   )
 )
)
Ben (Guest)
on 2006-05-21 22:29
Hello,

Try deleting your lighttpd.conf.

Then run "script/server" on your app WITHOUT anything else. Rails will
use lighttpd by default and import a lighttpd.conf

Hope this works.

Ben
Peter M. (Guest)
on 2006-05-21 23:12
(Received via mailing list)
On 5/21/06, Ben <removed_email_address@domain.invalid> wrote:
>
> Try deleting your lighttpd.conf.
>
> Then run "script/server" on your app WITHOUT anything else. Rails will
> use lighttpd by default and import a lighttpd.conf

Hi Ben,

Thanks for the advice. It did create an lighttpd.conf and I am able to
view the "Welcome aboard!" Rails page.

However when I generate a controller and basic view

$ script/generate controller front index

restart the server, and navigate to

http://localhost:3000/front

the server crashes. I look in log/fascgi.crash and find

[21/May/2006:12:03:40 :: 781] starting
[21/May/2006:12:04:06 :: 792] starting
[21/May/2006:12:04:40 :: 792] Dispatcher failed to catch:  (Interrupt)
  /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each'
  /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'
  /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in
`process!'
  /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:23:in
`process!'
  /Users/peter/temp/public/dispatch.fcgi:24
killed by this error





This all does work if I use webrick server.

Any ideas?

Thanks,
Peter
This topic is locked and can not be replied to.