# LightHTTPD FastCgi Error in Production Mode

**URL:** <https://www.ruby-forum.com/t/lighthttpd-fastcgi-error-in-production-mode/60235>\
**Category:** Rails\
**Created:** [May 11, 2006, 1:58pm UTC](https://www.ruby-forum.com/t/lighthttpd-fastcgi-error-in-production-mode/60235 "2006-05-11T13:58:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfeadler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mfeadler](https://www.ruby-forum.com/u/mfeadler)\
**Post date:** [May 11, 2006, 1:58pm UTC](https://www.ruby-forum.com/t/lighthttpd-fastcgi-error-in-production-mode/60235/1 "2006-05-11T13:58:20Z")

</div>

I’ve been banging my head against the following for about 8 hours now,  
and have exhausted my web research options:

/usr/home/matthew.feadler/rails/avclfc/public/dispatch.fcgi:21:in  
`require’: no such file to load –  
/usr/home/matthew.feadler/rails/avclfc/public/…/config/environment  
(LoadError)  
from  
/usr/home/matthew.feadler/rails/avclfc/public/dispatch.fcgi:21  
2006-05-11 04:21:12: (mod\_fastcgi.c.1048) the fastcgi-backend  
/usr/home/matthew.feadler/rails/avclfc/public/dispatch.fcgi failed to  
start:  
2006-05-11 04:21:12: (mod\_fastcgi.c.1052) child exited with status 1  
/usr/home/matthew.feadler/rails/avclfc/public/dispatch.fcgi  
–SNIP–  
2006-05-11 04:21:12: (mod\_fastcgi.c.1356) [ERROR]: spawning fcgi failed.  
2006-05-11 04:21:12: (server.c.834) Configuration of plugins failed.  
Going down.  
no such file to load –  
/usr/home/matthew.feadler/rails/avclfc/public/…/config/environment  
(LoadError)

My app works beautifully via WebRICK, both in Development and Production  
modes.

My Lighty fcgi config is as follows:

fastcgi.server = ( “.fcgi” =\>  
( “AVCNotes” =\>  
(  
“min-procs” =\> 1,  
“max-procs” =\> 5,  
“socket” =\> “/tmp/rails.socket”,  
“bin-path” =\>  
“/usr/home/matthew.feadler/rails/avclfc/public/dispatch.fcgi”,  
“bin-environment” =\> ( “RAILS\_ENV” =\> “production” )  
)  
)  
)

I’ve tried this both with and without the  
ENV[‘RAILS\_ENV’] ||= ‘production’  
line in environment.rb.

It may be pertinent that I’m using Lighty now because I was originally  
having fcgi issues with Apache, and suspected Apache was the culprit.  
Given subsequent events, I was likely wrong; but apart from this issue  
I’ve grown to like Lighty, and so will be sticking with it.

Thanks in advance,

-ELf

---

<div class="post-metadata">

**Author:** ![mfeadler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mfeadler](https://www.ruby-forum.com/u/mfeadler)\
**Post date:** [May 11, 2006, 3:26pm UTC](https://www.ruby-forum.com/t/lighthttpd-fastcgi-error-in-production-mode/60235/2 "2006-05-11T15:26:53Z")

</div>

Full Example:

$HTTP[“host”] =~ “[my.com](http://my.com)” {  
server.document-root = “/MY/PATH/public/”  
server.error-handler-404 = “/dispatch.fcgi”  
server.indexfiles = ( “dispatch.fcgi” )  
url.rewrite = ( “^/$” =\> “index.html”, “^([^.]+)$” =\>  
“$1.html” )  
accesslog.filename = “/MY/PATH/log/access.log”  
fastcgi.server = ( “.fcgi” =\>  
( “localhost” =\>  
(  
“min-procs” =\> 1,  
“max-procs” =\> 1,  
“socket” =\> “/MY/SOCKET/PATH/fcgi.socket”,  
“bin-path” =\> “/MY/BIN/PATH/public/dispatch.fcgi”,  
“bin-environment” =\> ( “RAILS\_ENV” =\> “production” )  
)  
)  
)  
}

On 5/11/06, Ben R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I’ve been banging my head against the following for about 8 hours now,  
> > start:  
> > My app works beautifully via WebRICK, both in Development and Production  
> > “bin-path” =\>  
> > It may be pertinent that I’m using Lighty now because I was originally
> > 
> > * * *

–  
Ben R.  
303-947-0446  
[http://www.benr75.com](http://www.benr75.com)

---

<div class="post-metadata">

**Author:** ![mfeadler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mfeadler](https://www.ruby-forum.com/u/mfeadler)\
**Post date:** [May 11, 2006, 3:20pm UTC](https://www.ruby-forum.com/t/lighthttpd-fastcgi-error-in-production-mode/60235/3 "2006-05-11T15:20:45Z")

</div>

Hi ~

The problem might be in another part of the config. What are you  
globally setting the document root to?

Just a thought…

~ Ben

On 5/11/06, Matthew F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> /usr/home/matthew.feadler/rails/avclfc/public/dispatch.fcgi failed to
> 
> ```
> "socket" => "/tmp/rails.socket",
> 
> ```
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Ben R.  
303-947-0446  
[http://www.benr75.com](http://www.benr75.com)

---

<div class="post-metadata">

**Author:** ![mfeadler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mfeadler](https://www.ruby-forum.com/u/mfeadler)\
**Post date:** [May 11, 2006, 4:02pm UTC](https://www.ruby-forum.com/t/lighthttpd-fastcgi-error-in-production-mode/60235/4 "2006-05-11T16:02:12Z")

</div>

Ben R. wrote:

> The problem might be in another part of the config. What are you  
> globally setting the document root to?

As it turns out, the problem was an issue of permissions on the config  
folder. The directory was not readable by my webserver user.

As usual, the hardest problems to solve end up being the easiest to fix.  
😛

Thanks much,

-ELf
