# Apache not running Fcgid

**URL:** <https://www.ruby-forum.com/t/apache-not-running-fcgid/54670>\
**Category:** Rails\
**Created:** [March 12, 2006, 1:31am UTC](https://www.ruby-forum.com/t/apache-not-running-fcgid/54670 "2006-03-12T01:31:59Z")\
**Posts on this page:** 5\
**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:** [March 12, 2006, 1:31am UTC](https://www.ruby-forum.com/t/apache-not-running-fcgid/54670/1 "2006-03-12T01:31:59Z")

</div>

I’m having the same problems as this fellow, Mr. Cheetham, in getting  
my rails app up and running on apache2+fcgid. Webrick runs, but  
dispatch.fcgi never actually runs, and apache spits out a grusome  
“Premature end of script headers: dispatch.cgi” error message in the  
log. Mr. Cheetham describes his problem at  
[http://www.archivesat.com/Typo\_blogging\_engine/thread164398.htm](http://www.archivesat.com/Typo_blogging_engine/thread164398.htm)

I can safely say dispatch.fcgi is not actually running because, like  
mr. Cheetham, I modified my dispatch.fcgi to spit out some foo into  
/tmp as soon as it is run. Foo is not being spat.

Manually running dispatch.fcgi gives me a 500 error and spits out some  
foo to /tmp.

Please assist, I’ve been going completely bonkers over this. There’s  
nothing in rails\_root/log, no useful info from apache… I want my 8  
hours back. I want this working. 😕

Thanks-a-many,  
Rektide

---

<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:** [March 12, 2006, 1:54am UTC](https://www.ruby-forum.com/t/apache-not-running-fcgid/54670/2 "2006-03-12T01:54:54Z")

</div>

In dispatch.fcgi the top line should have something like this:

#!/usr/bin/ruby

In a terminal decide where ruby is located by:

which ruby

and put the path after the exlamation mark. This is it in terms of rails  
configuration.

You might need other libraries related to fcgi to make this run. What  
distro/os do you run?

---

<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:** [March 12, 2006, 2:08am UTC](https://www.ruby-forum.com/t/apache-not-running-fcgid/54670/3 "2006-03-12T02:08:18Z")

</div>

I’m on RH/Fedora FC2. I compiled ruby 1.8.4, mod\_fcgid, a bunch of  
other stuff from source.

I’ve been hitting wall after wall on this deploy, I imported an older  
.htaccess that was still Rewriting to the .cgi, not the .fcgi. Now  
that its trying to run the .fcgi, I’m getting some output in the  
apache logs, although dispatch.fcgi is still not running. Here’s my  
output:

[Sat Mar 11 20:16:07 2006] [debug] fcgid\_proc\_unix.c(487):  
(111)Connection refused: mod\_fcgid: can’t connect unix domain socket:  
/home/geodb/config/fcgi/28988.13  
[Sat Mar 11 20:16:07 2006] [debug] fcgid\_proc\_unix.c(487):  
(111)Connection refused: mod\_fcgid: can’t connect unix domain socket:  
/home/geodb/config/fcgi/28988.14  
[Sat Mar 11 20:16:07 2006] [info] mod\_fcgid: can’t apply process slot  
for /home/httpd/vhosts/[host]/httpdocs/geo/dispatch.fcgi

/home/httpd/vhosts/[host]/httpdocs/geo is a softlink to /home/geodb

Again, manually running ./public/dispatch.fcgi gives me 500 error  
message and actually runs dispatch.fcgi. dispatch.fcgi doesnt seem to  
be the problem, looks like it’s mod\_fcgid not actually starting rails  
processes.

Thanks,  
rektide

---

<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:** [March 23, 2006, 12:51am UTC](https://www.ruby-forum.com/t/apache-not-running-fcgid/54670/4 "2006-03-23T00:51:44Z")

</div>

make sure that wherever in the apache config you are loading the module  
you also have these fcgid IPCCommTimeout and IPCConnectTimeout options  
set. example:

```
LoadModule fcgid_module modules/mod_fcgid.so
AddHandler fcgid-script .fcg
AddHandler fcgid-script .fcgi
IPCCommTimeout 40
IPCConnectTimeout 10
```

---

<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:** [March 12, 2006, 2:08am UTC](https://www.ruby-forum.com/t/apache-not-running-fcgid/54670/5 "2006-03-12T02:08:20Z")

</div>

Forgot to mention /home/geodb/config/fcgi directory is world writable,  
and accessible. Just another checkmark. Thanks.
