坏境:
192.168.200.112 tomcat2
192.168.200.103 tomcat1
192.168.200.111 Nginx
Nginx服务器:安装完Nginx的操作
安装完tomcat后的操作
tomcat1服务器:
[root@localhost ~]# mkdir -pv /web/webapp
[root@localhost ~]# vim /web/webapp/index.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
<head>
<title>JSP test page</title>
</head>
<body>
<% out.println("Welcome to test site,http://www.test1.com");%>
</body>
</html>
[root@localhost ~]# vim /usr/local/tomcat8/conf/server.xml
148行添加:
<Context docBase="/web/webapp" path="" reloadable="flase">
</Context>
[root@localhost ~]# /usr/local/tomcat8/bin/shutdown.sh
[root@localhost ~]# /usr/local/tomcat8/bin/startup.sh
tomcat2服务器:
唯一不同的地方就是:
[root@localhost ~]# vim /web/webapp/index.jsp
里面的test1改成test2
测试