# Apache/FastCGI causes error?

**URL:** <https://www.ruby-forum.com/t/apache-fastcgi-causes-error/77062>\
**Category:** Rails\
**Created:** [November 23, 2006, 9:19pm UTC](https://www.ruby-forum.com/t/apache-fastcgi-causes-error/77062 "2006-11-23T21:19:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [November 23, 2006, 9:19pm UTC](https://www.ruby-forum.com/t/apache-fastcgi-causes-error/77062/1 "2006-11-23T21:19:56Z")

</div>

I’m trying to get Ruby on Rails running on an Apache 1.3 server with  
mod\_fastcgi and I’m oh-so-close. When I run my application with this  
line in public/.htaccess it works fine. Unusably slow, but fine.

RewriteRule ^(.\*)$ dispatch.cgi [QSA,L]

However, when I change it to:

RewriteRule ^(.\*)$ dispatch.fcgi [QSA,L]

It doesn’t work at all, and returns the default “Application Error”.  
After going through my Apache error log I found the following two lines  
which would probably explain everything if I knew what they meant:

[alert] [client 216.221.90.34] (2)No such file or directory: FastCGI:  
failed to connect to (dynamic) server  
“/home/sites/home/web/railsapp/public/dispatch.fcgi”: something is  
seriously wrong, any chance the socket/named\_pipe directory was  
removed?, see the FastCgiIpcDir directive

[error] [client 216.221.90.34] FastCGI: incomplete headers (0 bytes)  
received from server  
“/home/sites/home/web/railsapp/public/dispatch.fcgi”

My apache config looks like this:  
  
FastCgiConfig -idle-timeout 900 -initial-env RAILS\_ENV=development  
FastCgiIpcDir /tmp/fastcgi\_ipc/  
AddHandler fastcgi-script .fcg .fcgi .fpl

/tmp/fastcgi/ is owned by Apache, and its permissions are set to 755. I  
also tried deleting all sessions from /tmp but to no avail.

Has anyone come across a similar error and been able to find a fix?  
I’ve Googled it but I can’t find much. I’m a pretty big newbie when it  
comes to Apache and frankly I’m surprised I’ve gotten as far as I have,  
so anyone that can help me get over this last hurdle will pretty much be  
my hero.

Thanks in advance,  
Sean

---

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [November 23, 2006, 10:33pm UTC](https://www.ruby-forum.com/t/apache-fastcgi-causes-error/77062/2 "2006-11-23T22:33:51Z")

</div>

Hmm… well I seem to have been able to fix this by changing my Apache  
config to this:

 FastCgiServer /home/sites/home/web/railsapp/public/dispatch.fcgi -idle-timeout 900 -initial-env RAILS\_ENV=development -processes 2 AddHandler fastcgi-script .fcg .fcgi .fpl

Where FastCgiServer is the full path to dispatch.fcgi
