Lighttpd + Mongrel setup

Hi

I’ve got Lighttpd and Mongrel setup on OS X

It works great when I have Lighty listening on 0.0.0.0:3000 and
mongrel on port 3001

BUT, when I bind lighty to 10.1.1.2:80 (the IP of my ethernet address)
it goes very very slow and static content (images, static html) does
not transfer at all :frowning:

What might be causing this?

I notice that Apache has no trouble serving content on the same IP as
the local ethernet address… and also webrick does it fine… so
obviously there is some kind of conflict within Lighty or Mongrel?

thanks for any ideas :slight_smile:

Why not just bind lighttpd to 0.0.0.0:80? Unless you have more than one
NIC, there’s no reason not to AFAIK.
This past week I’ve been working with mongrel/lighttpd, and it seems to
run very fast, the static files are 90% as fast as with lighttpd on its
own. Do you have your proxy set up correctly? This is the section from
my config file, and I don’t need to have any special directives in there
telling lighttpd to skip proxying for statics. In fact, lighttpd doesn’t
have to know anything about the app at all - just where to proxy to.

proxy.balance = “fair”
proxy.server = ( “/” =>
(
( “host” => “127.0.0.1”, “port” => 3000 ),

( “host” => “127.0.0.1”, “port” => 3009 )
) )

Thanks for the reply Jason,

Finally worked out that my problem was that Mongrel did not have read
access for my static/cached files.

So, Lighttpd would stall waiting for Mongrel to dish out the content,
and eventually serve broken content.

After fixing the read permissions, I wanted to make Lighttpd handle
all the static files… which is what I hoped it would do out of the
box. However, there is extra compilation to do in order to get
Lighttpd to “know” to deliver static stuff itself rather than
proxying to Mongrel. (See bottom half of http://
mongrel.rubyforge.org/docs/lighttpd.html)

Too lazy to go deeper with Lighttpd, I decided to try Nginx… and
it works beautifully and painlessly :slight_smile:

If anyone is interested, switching took me about 5 minutes after
following this: http://brainspl.at/articles/2006/09/12/new-nginx-
conf-with-rails-caching

Jas