欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2022-07-15 13:56:37
...
原文地址: http://*.com/questions/956361/apache-tomcat-using-mod-proxy-instead-of-ajp

以 CentOS 为例:
新建如下文件:
vim /etc/httpd/conf.d/proxy.conf
内容如下:
<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>
之后执行如下命令:
sudo /usr/sbin/setsebool -P httpd_can_network_connect 1
最后重启 Apache 即可:
sudo systemctl restart httpd