Linux下配置Apache2.2.6 与 Tomcat5.5集群

到Apache官方网站下载所需要的文件:

httpd-2.2.6.tar.gz

apache-tomcat-5.5.23.tar.gz

mod_jk-1.2.27-httpd-2.2.6.so

一、安装Apache

# tar xzvf httpd-2.2.6.tar.gz

# cd httpd-2.2.6

# ./configure --prefix=/usr/local/apache2 --enable-so

说明:--prefix为指定apache的安装路径(请按实际情况修改),其它项为预安装的模块, 除了 --enable-so 项外(--enable-so参数启用共享模块功能),可指定其它模块以后再安装

# make

# make install

二、复制mod_jk到modules

将 mod_jk-1.2.27-httpd-2.2.6.so放到apache下的modules文件夹下,并改名为mod_jk.so

注:mod_jk.so文件也可以在

http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/下载。

(mod_jk-1.2.27-httpd-2.2.6.so is for Apache 2.2.x and works with Apache 2.2.6 and later;

如果这样则不需要编译tomcat-connectors-1.2.26-src.tar.gz。)

如果此处的mod_jk.so是通过其它方法或者途径得到的,在后面启动apache的时候可能会提示:

Cannot load /usr/local/termite/apache/modules/mod_jk.so into server: /usr/local/termite/apache/modules/mod_jk.so: invalid ELF header

#file mod_jk.so

可能会显示 mod_jk.so: MS-DOS executable (EXE), OS/2 or MS Windows

而正确的应该显示

mod_jk.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped