利用apache的proxy-ajp做apache与tomcat的结合 jackey

   解压apache的源代码
            # tar xvjf httpd-2.2.0.tar.bz2
            # cd httpd-2.2.0

            安装apr
            # cd srclib/apr
            # ./configure --prefix=/server/soft/apr
            # make
            # make install

            安装apr-util
            # cd ../apr-util/
            # ./configure --prefix=/server/soft/apr-util \
              --with-apr=/server/soft/apr
            # make
            # make install
            # cd ../../

            安装apache
            # ./configure --prefix=/server/soft/apache \
              --enable-so \
              --enable-rewrite=share \
              --enable-proxy=share \
              --enable-proxy-ajp=share \
              --enable-dav=share \
              --with-apr=/server/soft/apr \
              --with-apr-util=/server/soft/apr-util/
            # make
            # make install

            # /server/soft/apache/bin/httpd -l //看看是否有proxy-ajp这个模块
            如果有这个模块证明proxy-ajp模块安装成功,可以进行与tomcat的结合了。

            # vi /server/soft/apache/conf/httpd.conf
            把"#Include conf/extra/httpd-vhosts.conf" 前面的"#"去掉然后编辑
            /server/soft/apache/conf/extra/httpd-vhosts.conf

            编辑为如下的代码
            <VirtualHost *:80>
              ServerAdmin [email protected]
              ProxyPass / ajp://localhost:8009/
              ProxyPassReverse / ajp://localhost:8009/
              ServerName localhost
              ServerAlias www.opensource.com.cn
              ErrorLog logs/easyea.com-error_log
              CustomLog logs/easyea.com-access_log common
            </VirtualHost>

            然后先启动tomcat,再启动apache
            # /server/soft/apache/bin/apachctl start
            打开浏览器看看是否看到了tomcat的欢迎页面,如果是说明apache和tomcat的结合成功

你可能感兴趣的:(apache,tomcat,浏览器,Access,OpenSource)