本站首页    管理页面    写新日志    退出


天堂之光 人间希望

你我共同品味

JAVA的浓香.

Linux的清芬.

«September 2025»
123456
78910111213
14151617181920
21222324252627
282930


我的分类(专题)

日志更新

最新评论

留言板

链接

联系我

msn:zhanglincon@hotmail.com


Blog信息
blog名称:
日志总数:99
评论数量:281
留言数量:4
访问次数:809965
建立时间:2005年11月17日




[Tomcat]利用apache的proxy-ajp做apache-2.2.0与tomcat-5.0.30的结合
文章收藏,  软件技术

zhanglincon 发表于 2008/1/25 14:46:32

今天偶然在网上发现apache-2.2.0增加了一个proxy-ajp模块,看了看它可以完全代替原来的mod-jk把tomcat和apache结合到一起。于是我就下载下来试了一下真的很方便比原来的方法简单多了。下面就说明一下我的安装步骤。tomcat和jdk的安装网上太多的教程我在这里就不再介绍了。大家可以去查看其他的教程。 首先从http://www.apache.org的网站上下载apache-2.2.0的源代码。apache-2.2.0的版本做了些改动大家需要注意一下。首先apr和apr-util需要单独的安装,还有配置文件由原来的一个变为现在的多个不过这样也好,可以清楚的知道那部分配置在那个配置文件里方便修改。安装步骤如下: 解压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 编辑为如下的代码 ServerAdmin admin@idconline.ccProxyPass / ajp://localhost:8009/ProxyPassReverse / ajp://localhost:8009/ServerName localhostServerAlias www.idconline.ccErrorLog logs/www.idconline.cc-error_logCustomLog logs/www.idconline.cc-access_log common 然后先启动tomcat,再启动apache# /server/soft/apache/bin/apachctl start打开浏览器看看是否看到了tomcat的欢迎页面,如果是说明apache和tomcat的结合成功 附:同时整合多个不同域名的tomcat配置范例 ServerAdmin xxx@xxxProxyPass / ajp://localhost:8109/ProxyPassReverse / ajp://localhost:8109/ServerName localhostErrorLog logs/xxx.xxx-error_logCustomLog logs/xxx.xxx-access_log common ServerAdmin xxx@xxxProxyPass / ajp://localhost:11009/ProxyPassReverse / ajp://localhost:11009/ServerName test.xxx.xxxErrorLog logs/test.xxx.xxx-error_logCustomLog logs/test.xxx.xxx-access_log common


阅读全文(2296) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.031 second(s), page refreshed 144792066 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号