# Rails, fastcgi, spawn-fgi and lighttpd 1.4.26

## knirirr

A recent upgrade of lighttpd has taken me by surprise by causing fastcgi to stop working on my rails installation.

The little documentation I've been able to find says that the spawn-fgi init script is now to be used, e.g. by creating a config file with something like:

```

FCGI_PROGRAM=/usr/bin/php-cgi

```

Would anyone be able to tell me how to get this working for rails? Setting that value to /usr/bin/ruby or $RAILS_ROOT/public/dispatch.fcgi causes the following:

```

daoloth init.d # /etc/init.d/spawn-fcgi.ruby start

 * Caching service dependencies ...                                                                 [ ok ]

 * Starting FastCGI application ruby ...

spawn-fcgi: child exited with: 1                                                                    [ !! ]

```

This happens whether I specify a socket or a port and there does not appear to be any log anywhere. 

As I am totally stuffed at the moment any suggestions would be welcome.

----------

## knirirr

The solution turned out to be:

Give up on lighttpd/fastcgi and replace with nginx/passenger. It's a shame that the nginx ebuild doesn't include passenger, but at least my site now works.

----------

## a3li

 *knirirr wrote:*   

> The solution turned out to be:
> 
> Give up on lighttpd/fastcgi and replace with nginx/passenger. It's a shame that the nginx ebuild doesn't include passenger, but at least my site now works.

 

The nginx ebuilds in testing (~arch) support passenger, fyi.

----------

## knirirr

 *a3li wrote:*   

> 
> 
> The nginx ebuilds in testing (~arch) support passenger, fyi.

 

Thanks - I'll give them a try.Last edited by knirirr on Mon Jul 12, 2010 8:08 am; edited 1 time in total

----------

## BitJam

Lighttpd behaved very badly once with a normal CGI script.  It ran the script thousands of times in response to a single request, performing a self-inflicted DOS attack on me.  The script ran perfectly fine under other web servers.

If you have a problem with lighttpd + fastcgi, I would bet the problem is with lighhttpd and not fastcgi.

----------

## knirirr

 *BitJam wrote:*   

> 
> 
> If you have a problem with lighttpd + fastcgi, I would bet the problem is with lighhttpd and not fastcgi.

 

I'm convinced that it's the combination of rails and fastcgi; lighttpd is usually well behaved with php.

----------

