安装httpd 2.2版本
#yum install httpd
#cd /usr/lib64/httpd/modules/
#ls --需要apache已经装载mod_proxy、mod_proxy_http、mod_proxy_ajp和proxy_balancer_module(实现Tomcat集群时用到)等模块
#cd /etc/httpd/conf/
#vi proxy.conf
ProxyVia on
ProxyRequests off
ProxyPreserveHost on
ProxyPass / http://localhost:8080/ 或 ajp://localhost:8009/
ProxyPassReverse / http://localhost:8080/ 或 ajp://localhost:8009/
<Location />
Order Allow,Deny
Allow from all
</Location>
保存退出;
#httpd -t
#service httpd restart
如果用apache 代理tomcat时可以用ajp协议;关掉tomcat http端口
时间: 2024-10-16 03:26:50