apache2.2.2+mod_jk

今日はこれまた都合があって、apache2.2.2+mod_jkを作ってたりしています。
これがまたうまく行かないときた。まず、jakarta-tomcat-connectors-1.2.15-srcのソースを入手して、展開、buildconf.shを実行するとこんなwarningが出ます。

rm autom4te.cache
libtoolize --force --automake --copy
aclocal
/usr/share/aclocal/xml-i18n-tools.m4:24: warning: underquoted definition of XML_I18N_TOOLS_NEWER_THAN_0_9
  run info '(automake)Extending aclocal'
  or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
/usr/share/aclocal/xml-i18n-tools.m4:28: warning: underquoted definition of AC_PROG_XML_I18N_TOOLS
/usr/share/aclocal/xml-i18n-tools.m4:30: warning: underquoted definition of X18T_PFORG1
/usr/share/aclocal/xml-i18n-tools.m4:32: warning: underquoted definition of X18T_XML_KIND
/usr/share/aclocal/xml-i18n-tools.m4:34: warning: underquoted definition of X18T_KEYS_KIND
/usr/share/aclocal/xml-i18n-tools.m4:135: warning: underquoted definition of AM_PROG_XML_I18N_TOOLS
/usr/share/aclocal/vorbis.m4:9: warning: underquoted definition of XIPH_PATH_VORBIS

(略)
/usr/share/aclocal/ao.m4:9: warning: underquoted definition of XIPH_PATH_AO
/usr/share/aclocal/ORBit2.m4:4: warning: underquoted definition of AM_PATH_ORBIT2
/usr/share/aclocal/ORBit.m4:4: warning: underquoted definition of AM_PATH_ORBIT
autoheader
automake -a --foreign --copy
autoconf
rm autom4te.cache

まぁいいかと無視して、configureをかけて(これはワーニングもなにもなし)makeすると今度はこんなエラーが。

Making all in common
make[1]: 入ります ディレクトリ `/home/hoge/apache/jakarta-tomcat-connectors-1.2.15-src/jk/native/common'
make[1]: `all' に対して行うべき事はありません。
make[1]: 出ます ディレクトリ `/home/hoge/apache/jakarta-tomcat-connectors-1.2.15-src/jk/native/common'
Making all in apache-2.0
make[1]: 入ります ディレクトリ `/home/hoge/apache/jakarta-tomcat-connectors-1.2.15-src/jk/native/apache-2.0'
/bin/sh ../libtool --mode=compile gcc -I/home/hoge/apache/httpd-2.2.2/include -I/home/hoge/apache/httpd-2.2.2/srclib/apr/include -I/home/hoge/apache/httpd-2.2.2/os/unix -I/home/hoge/apache/httpd-2.2.2/srclib/apr-util/include -I/usr/local/apache2/include -DUSE_APACHE_MD5 -I ../common  -I /include -I /include/  -I/usr/local/apache2/include   -c mod_jk.c -o mod_jk.lo
rm -f .libs/mod_jk.lo
gcc -I/home/hoge/apache/httpd-2.2.2/include -I/home/hoge/apache/httpd-2.2.2/srclib/apr/include -I/home/hoge/apache/httpd-2.2.2/os/unix -I/home/hoge/apache/httpd-2.2.2/srclib/apr-util/include -I/usr/local/apache2/include -DUSE_APACHE_MD5 -I ../common -I /include -I /include/ -I/usr/local/apache2/include -c mod_jk.c  -fPIC -DPIC -o .libs/mod_jk.lo
In file included from /home/hoge/apache/httpd-2.2.2/include/ap_config.h:25,
                 from mod_jk.c:28:
/usr/local/apache2/include/apr.h:270: syntax error before "apr_off_t"
(後略)

なんなんだいったい。えーと、

In file included from /home/hoge/apache/httpd-2.2.2/include/ap_config.h:25,
                 from mod_jk.c:28:
/usr/local/apache2/include/apr.h:270: syntax error before "apr_off_t"

っていってるな。つまり、mod_jk.cが期待しているapr.hと入ってるapr.hが違うんだな。
もしかして、apache2.2ではmod_jkは使えないのかなと思いついて少ししらべたところ、その模様。ふんがー。2.2ではjakartaに接続する方法がちがうってことね。なるほど。apache2.2以降でtomcatとお話するには、mod_proxyを経由するみたいです。こんな感じ。
apacheをmod_proxyとmod_proxy_ajpをenableするようにconfigureしてmake
httpd.confにこう書く。

 
     ProxyPass /location ajp://disthost:8009/location