Is mod_fastcgi really required for Ruby/Apache 2?


#1

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) 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


#2

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.


#3

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
(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


#4

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


#5
  • 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
(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

Which pretty much does the same thing.