I am unable to build a Solaris version of the mod_jserv module that I need for connecting the Tomcat 3.1 servlet engine to the Apache web server 1.3.12. What gives?
The Tomcat-Apache HOWTO document calls for executing the following command for building the mod_jserv module for a Unix environment:
apxs -c -o mod_jserv.so *.cinside the directory:
TOMCAT_SRC/src/native/apache/jservwhere apxs, the Apache extension tool, is to be found in the APACHE_HOME/bin directory.
I believe that there was no problem in building mod_jserv on Solaris in the manner described above with the earlier versions of Tomcat and the Apache web server. But somewhere along the line, that stopped being the case. I noticed pleas for help on various mailing lists and bulletin boards, with people complaining that when they tried to do as instructed above under Solaris, they got the following error message from apxs:
apxs:Break: Command failed with rc=16711680which was the same error message that I was getting in my attempts to build mod_jserv for Solaris.
I wrote individually to the various authors of those earlier posts to see if they had succeeded in solving the problem. I heard back from many, and even received a fix that works from Sven Koepfer.
I have tested Sven Koepfer's solution. With this solution in place, I was able to build a Solaris version of mod_jserv.so. I then copied this module into the directory APACHE_HOME/libexec/ and achieved a successful integration of Tomcat 3.1 and the Apache server 1.3.12.
Here is Sven Koepfer's solution:
In the file apxs in the APACHE_HOME/bin directory, replace the following lines
my $CFG_CFLAGS_SHLIB = q(); # substituted via Makefile.tmpl my $CFG_LD_SHLIB = q(); # substituted via Makefile.tmpl my $CFG_LDFLAGS_SHLIB = q(); # substituted via Makefile.tmplby the following lines
my $CFG_CFLAGS_SHLIB = q(-fpic -DSHARED_MODULE); # substituted via Makefile.tmpl my $CFG_LD_SHLIB = q(gcc); # substituted via Makefile.tmpl my $CFG_LDFLAGS_SHLIB = q(-shared); # substituted via Makefile.tmplThat's all you have to do to fix the apxs file. Now execute the command line
apxs -c -o mod_jserv.so *.cand you'll have your Solaris version of mod_jserv.so.
If you are new to mod_jserv, you must read a recent posting on the subject by Alex Chaffee. It will give you a bit of historical perspective on how this module has evolved and why it is very different from a module of the same name that connected the JServ servlet engine to the Apache server. This posting by Alex also talks about the module mod_jk that is supposed to replace mod_jserv for connecting the more recent versions of Tomcat with the Apache server. However, note that mod_jk is not intended for Tomcat 3.1.