[转] Apache + Tomcat: Using mod_proxy instead of AJP 转发 80 端口

原文地址: http://stackoverflow.com/questions/956361/apache-tomcat-using-mod-proxy-instead-of-ajp
以 CentOS 为例:
新建如下文件:

1
vim /etc/httpd/conf.d/proxy.conf

内容如下:

1
2
3
4
5
6
7
8
9
10
11
<VirtualHost *:80>
ServerName public.server.name
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>

之后执行如下命令:

1
sudo /usr/sbin/setsebool -P httpd_can_network_connect 1

最后重启 Apache 即可:

1
sudo systemctl restart httpd

坚持原创及高品质技术分享,您的支持将鼓励我继续创作!