# Is mod\_fastcgi really required for Ruby/Apache 2?

**URL:** <https://www.ruby-forum.com/t/is-mod-fastcgi-really-required-for-ruby-apache-2/83002>\
**Category:** Ruby\
**Created:** [January 22, 2007, 11:47pm UTC](https://www.ruby-forum.com/t/is-mod-fastcgi-really-required-for-ruby-apache-2/83002 "2007-01-22T23:47:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 22, 2007, 11:47pm UTC](https://www.ruby-forum.com/t/is-mod-fastcgi-really-required-for-ruby-apache-2/83002/1 "2007-01-22T23:47:06Z")

</div>

Hi,

I’m trying to install the latest version of Ruby to work with a  
just-newly installed Apache 2.2 module on my x86 Fedora Core 5 Linux  
machine. I read  
([http://wiki.rubyonrails.com/rails/pages/RailsOnFedora](http://wiki.rubyonrails.com/rails/pages/RailsOnFedora)) that  
mod\_fastcgi is required, but when I download, copy the appropriate  
Makefile and try to make, I get errors (see below if you’re really  
interested). I also notice that the latest version of mod\_fastcgi is  
dated 2004. Is this truly required or can I skip this step?

Thanks, - Dave

======BEGIN PERILOUS ERROR REPORT===============  
[root@localhost mod\_fastcgi-SNAP-0404142202]# cp Makefile.AP2 Makefile  
[root@localhost mod\_fastcgi-SNAP-0404142202]# make  
/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -pthread  
-DLINUX=2 -D\_REENTRANT -D\_GNU\_SOURCE -D\_LARGEFILE64\_SOURCE  
-I/usr/local/apache2/include -I. -I/usr/include/apr-1 -I/usr/include  
-I/usr/kerberos/include -prefer-pic -c mod\_fastcgi.c && touch  
mod\_fastcgi.slo  
mod\_fastcgi.c: In function ‘init\_module’:  
mod\_fastcgi.c:271: error: ‘ap\_null\_cleanup’ undeclared (first use in  
this function)  
mod\_fastcgi.c:271: error: (Each undeclared identifier is reported only  
once  
mod\_fastcgi.c:271: error: for each function it appears in.)  
mod\_fastcgi.c: In function ‘process\_headers’:  
mod\_fastcgi.c:726: warning: return makes pointer from integer without a  
cast  
mod\_fastcgi.c:730: warning: assignment makes pointer from integer  
without a cast  
mod\_fastcgi.c:740: warning: assignment makes pointer from integer  
without a cast  
mod\_fastcgi.c:769: warning: initialization makes pointer from integer  
without a cast  
mod\_fastcgi.c:839: warning: return makes pointer from integer without a  
cast  
mod\_fastcgi.c:843: warning: return makes pointer from integer without a  
cast  
mod\_fastcgi.c: In function ‘set\_uid\_n\_gid’:  
mod\_fastcgi.c:1023: warning: passing argument 1 of ‘memcpy’ makes  
pointer from integer without a cast  
mod\_fastcgi.c:1025: warning: assignment makes pointer from integer  
without a cast  
mod\_fastcgi.c:1034: warning: assignment makes pointer from integer  
without a cast  
mod\_fastcgi.c:1035: warning: assignment makes pointer from integer  
without a cast  
mod\_fastcgi.c: In function ‘do\_work’:  
mod\_fastcgi.c:2322: error: ‘ap\_null\_cleanup’ undeclared (first use in  
this function)  
mod\_fastcgi.c: In function ‘create\_fcgi\_request’:  
mod\_fastcgi.c:2480: warning: assignment makes pointer from integer  
without a cast  
mod\_fastcgi.c:2493: warning: assignment makes pointer from integer  
without a cast  
mod\_fastcgi.c: In function ‘apache\_is\_scriptaliased’:  
mod\_fastcgi.c:2535: warning: initialization makes pointer from integer  
without a cast  
mod\_fastcgi.c: In function ‘post\_process\_for\_redirects’:  
mod\_fastcgi.c:2560: warning: passing argument 1 of  
‘ap\_internal\_redirect\_handler’ makes pointer from integer without a  
cast  
mod\_fastcgi.c: In function ‘check\_user\_authentication’:  
mod\_fastcgi.c:2683: warning: assignment makes pointer from integer  
without a cast  
mod\_fastcgi.c:2701: warning: comparison between pointer and integer  
mod\_fastcgi.c: In function ‘check\_user\_authorization’:  
mod\_fastcgi.c:2750: warning: assignment makes pointer from integer  
without a cast  
mod\_fastcgi.c:2766: warning: comparison between pointer and integer  
mod\_fastcgi.c: In function ‘check\_access’:  
mod\_fastcgi.c:2810: warning: assignment makes pointer from integer  
without a cast  
mod\_fastcgi.c:2827: warning: comparison between pointer and integer  
make: \*\*\* [mod\_fastcgi.slo] Error 1

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 23, 2007, 1:19am UTC](https://www.ruby-forum.com/t/is-mod-fastcgi-really-required-for-ruby-apache-2/83002/2 "2007-01-23T01:19:26Z")

</div>

On Tue, 2007-01-23 at 07:45 +0900, removed\_email\_address@domain.invalid wrote:

> mod\_fastcgi.slo  
> mod\_fastcgi.c: In function ‘init\_module’:  
> mod\_fastcgi.c:271: error: ‘ap\_null\_cleanup’ undeclared (first use in  
> this function)  
> mod\_fastcgi.c:271: error: (Each undeclared identifier is reported only  
> once

mod\_fastcgi isn’t _strictly_ needed, but it is worth the speedup. You  
can use CGI instead, but not meant for production usage. There are other  
options such as lightppd, mongrel, etc, but I’ll let others with more  
experience in that area address that.

I on the otherhand do us mod\_fastcgi on an apache 2.0 system for  
production and I also use an apache 2.2 system as my local testing  
system (and Webrick occasionally too)

Now as to your error, try adding the following to your make file:

-D\_LARGEFILE64\_SOURCE

I don’t know the entire story on this other than there is a 64/32 bit  
issue with the size of a datatype in C that is referenced in the apr.h  
file. I could be wrong on the fix, but it looks like the same one I was  
getting for a different project.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 23, 2007, 8:22am UTC](https://www.ruby-forum.com/t/is-mod-fastcgi-really-required-for-ruby-apache-2/83002/3 "2007-01-23T08:22:09Z")

</div>

removed\_email\_address@domain.invalid wrote:

> I’m trying to install the latest version of Ruby to work with a  
> just-newly installed Apache 2.2 module on my x86 Fedora Core 5 Linux  
> machine. I read  
> ([Peak Obsession](http://wiki.rubyonrails.com/rails/pages/RailsOnFedora)) that  
> mod\_fastcgi is required, but when I download, copy the appropriate  
> Makefile and try to make, I get errors (see below if you’re really  
> interested). I also notice that the latest version of mod\_fastcgi is  
> dated 2004. Is this truly required or can I skip this step?

mod\_fastcgi has a _lot_ of issues that can trip you up, including long-  
running processes becoming zombies and enigmatic IPC timeouts. Since  
you’re running on apache 2, I recommend mod\_fcgid instead. Much more  
stable.

Daniel

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 23, 2007, 5:51pm UTC](https://www.ruby-forum.com/t/is-mod-fastcgi-really-required-for-ruby-apache-2/83002/4 "2007-01-23T17:51:17Z")

</div>

Thanks for your reply, but that directive was already in the make  
execution …

[root@localhost mod\_fastcgi-SNAP-0404142202]# cp Makefile.AP2 Makefile  
[root@localhost mod\_fastcgi-SNAP-0404142202]# make  
/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -pthread  
-DLINUX=2 -D\_REENTRANT -D\_GNU\_SOURCE -D\_LARGEFILE64\_SOURCE  
-I/usr/local/apache2/include -I. -I/usr/include/apr-1 -I/usr/include  
-I/usr/kerberos/include -prefer-pic -c mod\_fastcgi.c && touch  
mod\_fastcgi.slo

(I just cut and paste the first few lines from my original post). -  
Dave

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 23, 2007, 6:24pm UTC](https://www.ruby-forum.com/t/is-mod-fastcgi-really-required-for-ruby-apache-2/83002/5 "2007-01-23T18:24:29Z")

</div>

- removed\_email\_address@domain.invalid (removed\_email\_address@domain.invalid) wrote:

> I’m trying to install the latest version of Ruby to  
> work with a just-newly installed Apache 2.2 module  
> on my x86 Fedora Core 5 Linux machine. I read  
> ([Peak Obsession](http://wiki.rubyonrails.com/rails/pages/RailsOnFedora)) that  
> mod\_fastcgi is required, but when I download, copy the appropriate  
> Makefile and try to make, I get errors (see below if you’re really  
> interested). I also notice that the latest version of mod\_fastcgi is  
> dated 2004. Is this truly required or can I skip this step?

You can use an application server like mongrel and just use  
mod\_proxy(\_balancer) if you like. I tend to prefer this to faffing  
about with FastCGI application managers or fcgi.rb hacks to support  
external servers.

> mod\_fastcgi.c: In function ‘init\_module’:  
> mod\_fastcgi.c:271: error: ‘ap\_null\_cleanup’ undeclared (first use in  
> this function)

Apache 2.2 drops the ap\_\* functions (or rather, the mapping of ap\_\* to  
apr\_\*). You can either replace them with the appropriate apr functions,  
or use this patch:

[http://fastcgi.com/archives/fastcgi-developers/2005-December/004060.html](http://fastcgi.com/archives/fastcgi-developers/2005-December/004060.html)

Which pretty much does the same thing.
