# First try with lighttpd

**URL:** <https://www.ruby-forum.com/t/first-try-with-lighttpd/61179>\
**Category:** Rails\
**Created:** [May 21, 2006, 2:24am UTC](https://www.ruby-forum.com/t/first-try-with-lighttpd/61179 "2006-05-21T02:24:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [May 21, 2006, 2:24am UTC](https://www.ruby-forum.com/t/first-try-with-lighttpd/61179/1 "2006-05-21T02:24:57Z")

</div>

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

> **[Dan Benjamin](https://danbenjamin.com)**
>
> Dan Benjamin's personal website.

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” )  
)  
)  
)

---

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [May 21, 2006, 6:35pm UTC](https://www.ruby-forum.com/t/first-try-with-lighttpd/61179/2 "2006-05-21T18:35:46Z")

</div>

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](mailto: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” )  
)  
)  
)

---

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [May 21, 2006, 8:29pm UTC](https://www.ruby-forum.com/t/first-try-with-lighttpd/61179/3 "2006-05-21T20:29:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [May 21, 2006, 9:12pm UTC](https://www.ruby-forum.com/t/first-try-with-lighttpd/61179/4 "2006-05-21T21:12:53Z")

</div>

On 5/21/06, Ben [removed\_email\_address@domain.invalid](mailto: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](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
