1、apr安装
cd apr
./configure --prefix=/usr/local/apr/ && make && make install
2、apr-util安装
cd ../apr-util
./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr/ && make && make install
3、pcre安装
cd pcre-8.10
./configure --prefix=/usr/local/pcre && make && make install
4、http 2.4.3安装
加入--with-included-apr 编译必须把apr,apr-util 的源文件放到 apache2.4.3源码的srclib目录下,并修改apr源码目录为apr,apr-util源码目录为apr-util
cp -rf apr-1.4.3 ./srclib/apr
cp -rf apr-util-1.4.1 ./srclib/apr-util
./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-deflate --enable-speling --enable-cache --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-ssl --with-ssl=/usr/local/openssl/ --enable-rewrite --enable-so --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre --with-included-apr
make
make install
5、安装tomcat-connectors ( mod_jk.so 模块 )
tar zxvf tomcat-connectors-1.2.37-src .tar.gz
cd tomcat-connectors-1.2.37-src/native/
./configure --with-apxs=/usr/local/apache2/bin/apxs --with-java-home=/usr/local/jdk
make && make install
检查/usr/local/apache2/modules下是否有mod_jk.so ,如果没有就复制过去。
注意 conf/httpd.conf 文件中 ServerName xxx.xxx.com:80 需要改为 ServerName 127.0.0.1:80
可以使用apactrl -t //进行语法分析