问题:
服务器上同时安装了Apache和Tomcat。
原本有个PHP web网站A,运行在Apache下,通过域名www.test.cn访问。
新增一个 SpringMvc 架构的网站B,运行在Tomcat下。
现在B项目也希望通过域名访问,可是80端口已经被Apache使用了。如何能让Tomcat下的网站也能对外呈现80端口,通过域名访问呢?
解决方法:
配置Apache反向代理Tomcat。
在原有域名下新增一个二级域名level2.test.cn,当用户访问B网站时,首先访问此二级域名(80端口),然后由Apache把该域名下的请求转发到Tomcat(8080端口)。
环境:
服务器:阿里云CentOs7;
Apache version :2.6.4。
Tomcat version: 8.5.45。
具体实现:
1)确认 Apache 启用了代理模块
打开httpd.conf文件:
vi /etc/httpd/conf/httpd.conf
看下面这段
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd

2473

被折叠的 条评论
为什么被折叠?



