apache+tomcat for proxy_ajp
apache+tomcat for proxy_ajp
说明:
环境: REHL_A4_U4_X32
东东: httpd-2.2.3.tar.gz
apache-tomcat-5.5.15.tar.gz
jdk-1_5_0_07-linux-i586.bin
源文件存放位置: /home
安装步骤: 1.setup apache
2.setup tomcat(include jdk)
3.edit http.conf
以下是自己的安装脚本
1. setup apache
#!/bin/sh
APACHE_SRC_DIR="/home/httpd-2.2.3"
echo apache2-install
cd /home;tar vxfz httpd-2.2.3.tar.gz
cd $APACHE_SRC_DIR/srclib/apr
./configure --prefix=/usr/local/apr12/
make clean
make
make install
cd $APACHE_SRC_DIR/srclib/apr-util
./configure --prefix=/usr/local/apr12-util/ --with-apr=/usr/local/apr12/
make clean
make
make install
cd $APACHE_SRC_DIR
./configure --prefix=/usr/local/apache22 --with-apr=/usr/local/apr12 --with-apr-util=/usr/local/apr12-util --with-mpm=worker --enable-so --enable-mods-shared=all --enable-proxy=shared --enable-proxy-balancer=shared --enable-proxy-http=shared --enable-proxy-ajp --enable-deflate --enable-cache --enable-disk-cache --enable-mem-cache
make clean
make
make install
1. setup tomcat
#!/bin/sh
echo Tomcat Set
#删除原java
rpm -e --nodeps gcc-java
rpm -e --nodeps java-1.4.2-gcj-compat
cd /home
mv jdk1.5.0_06 /usr/local/jdk
tar vxfz apache-tomcat-5.5.15.tar.gz
mv apache-tomcat-5.5.15 /usr/local/Tomcat55
echo 'export JAVA_HOME=/usr/local/jdk' >>/etc/profile
echo 'export PATH=$PATH: $JAVA_HOME/bin' >>/etc/profile
echo 'export CLASSPATH=$JAVA_HOME/lib/tools.jar: $JAVA_HOME/lib/dt.jar' >>/etc/profile
echo 'export CATALINA_HOME=/usr/local/Tomcat55' >>/etc/profile
source /etc/profile
3. edit http.conf
在最后添加下面几行:
ProxyPass / ajp://127.0.0.1:8009/
ProxyPassReverse / ajp://127.0.0.1:8009/