1

I've compiled Apache 2.4.2 successfully, but I'm facing an error while trying to compile mod_fastcgi module.

Any tips?

root@local:/usr/src/libapache-mod-fastcgi# /usr/local/apache2/bin/apxs -o mod_fastcgi.so -c *.c
/usr/local/apr/build-1/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread -I/usr/local/apache2/include  -I/usr/local/apr/include/apr-1   -I/usr/local/apr/include/apr-1   -c -o fcgi_buf.lo fcgi_buf.c && touch fcgi_buf.slo
/usr/local/apr/build-1/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread -I/usr/local/apache2/include  -I/usr/local/apr/include/apr-1   -I/usr/local/apr/include/apr-1   -c -o fcgi_config.lo fcgi_config.c && touch fcgi_config.slo
fcgi_config.c: In function 'fcgi_config_set_fcgi_uid_n_gid':
fcgi_config.c:241: error: 'unixd_config' undeclared (first use in this function)
fcgi_config.c:241: error: (Each undeclared identifier is reported only once
fcgi_config.c:241: error: for each function it appears in.)
fcgi_config.c: In function 'fcgi_config_make_dir':
fcgi_config.c:345: error: 'unixd_config' undeclared (first use in this function)
fcgi_config.c: In function 'fcgi_config_new_static_server':
fcgi_config.c:782: warning: initialization from incompatible pointer type
fcgi_config.c:782: error: expected expression before ')' token
fcgi_config.c:782: warning: passing argument 5 of 'ap_log_error_' makes integer from pointer without a cast
/usr/local/apache2/include/http_log.h:372: note: expected 'apr_status_t' but argument is of type 'struct server_rec *'
fcgi_config.c: In function 'fcgi_config_new_external_server':
fcgi_config.c:975: warning: initialization from incompatible pointer type
fcgi_config.c:975: error: expected expression before ')' token
fcgi_config.c:975: warning: passing argument 5 of 'ap_log_error_' makes integer from pointer without a cast
/usr/local/apache2/include/http_log.h:372: note: expected 'apr_status_t' but argument is of type 'struct server_rec *'
apxs:Error: Command failed with rc=65536
.
root@local:/usr/src/libapache-mod-fastcgi#

7 Answers 7

1

As far I remember there was some kind of error with mod_fastcgi and Apache 2.4. Just checked version 2.2 and it compiles perfectly. Can't find a bug report now.

2

almost certain it's due to Apache changing the unixd_config api name to ap_unixd_config in v2.4.x

http://httpd.apache.org/docs/2.4/developer/new_api_2_4.html

I've been fighting this trying to get it 2.4 working with mod_fastcgi, I even tried editing fcgi.h (the only references to unixd_config I could find in the mod_fastcgi source files) to add

#define unixd_config ap_unixd_config

or otherwise rename all references to unixd_config, but neither of those worked.

I'm starting to wonder if there might also be some references to unixd_config in apr / apr-devel packages since they are required to compile mod_fastcgi, and I had to find a newer version (1.4.6 I believe, as yum installs old 1.3.9), and place them into the srclib folder of apache 2.4.3 source in order for it to compile without errors (like shown here: http://www.thegeekstuff.com/2012/05/install-apache-2-on-centos-6/)

This is really frustrating because I want apache 2.4 but do not want to run php as mod_php but the "new & improved" method using mod_proxy_fcgi with php fpm has all sorts of issues like not wanting to play nice with aliases :(

2

Did you try this patch for mod_fastcgi?

2

I found the answer in this link: http://leeon.me/a/apache-2.4-install-mod_fastcgi (I'm speaker spanish, I did need to "read" Chinese")

You can execute the next, to do the wanted (verify your paths, I'm using RPM layout):

time (wget 'http://www.fastcgi.com/dist/mod_fastcgi-SNAP-0910052141.tar.gz' &&
tar -zxvf mod_fastcgi-SNAP-0910052141.tar.gz &&
cd mod_fastcgi-SNAP-0910052141 &&
cp Makefile.AP2 Makefile &&
wget http://leeon.me/upload/other/byte-compile-against-apache24.diff &&
patch -p1 < byte-compile-against-apache24.diff &&
make top_dir=/usr/lib/httpd/ && make install top_dir=/usr/lib/httpd/)

Manual ...

nano /etc/httpd/conf/httpd.conf/httpd.conf
LoadModule fastcgi_module lib/httpd/modules/mod_fastcgi.so
0

You don't have all the dependencies installed.

3
  • That's what I think it may be. Any thoughts? APR installed, apr-utils installed, Apache installed - no clue.
    – Jari V.
    Commented Aug 20, 2012 at 18:06
  • do you have the apache headers in your include path? Commented Aug 20, 2012 at 18:15
  • Trying Googling for that. Do you have a link about headers in linux, include path and how to add them into?
    – Jari V.
    Commented Aug 20, 2012 at 18:47
0

Try checking libtool installed in /usr/local/apache2/bin/ and installed in you system, they may be of different conflicting versions.

0

There is seriously no reason to use this unsupported, 3rd-party module.

Either use the apache-provided mod_fcgid, or the new mod_proxy_fcgi module.

1
  • mod_fcgid gives the same unixd_config error as mod_fastcgi 2.4 :(
    – WebChemist
    Commented Aug 31, 2012 at 1:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .