浏览器网页中访问http://${Linux服务器的IP}:9001/basketball/index.html,浏览器中打印"篮球8080!!!";
浏览器网页中访问http://${Linux服务器的IP}:9001/football/index.html,浏览器中打印"足球8081!!!";
- cd /opt/tomcat
-
- mkdir tomcat8080
-
- mkdir tomcat8081

tar -zxvf apache-tomcat-8.5.63.tar.gz
- cd /opt/tomcat/tomcat8080/apache-tomcat-8.5.63/webapps/
-
- mkdir basketball

- html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>首页title>
- head>
- <body>
- <p style="color: red;font-size: 30px" align="center">篮球8080!!!p>
- body>
- html>
- /opt/tomcat/tomcat8080/apache-tomcat-8.5.63/bin
-
- ./startup.sh

2.4、tomcat8081配置tar -zxvf apache-tomcat-8.5.63.tar.gz
- cd /opt/tomcat/tomcat8080/apache-tomcat-8.5.63/webapps/
-
- mkdir football
- html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>首页title>
- head>
- <body>
- <p style="color: red;font-size: 30px" align="center">足球8081!!!p>
- body>
- html>
- 修改如下三个端口:
- Server port、onnector port、redirectPort

- /opt/tomcat/tomcat8081/apache-tomcat-8.5.63/bin
-
- ./startup.sh


- cd /usr/local/nginx/conf/
-
- vim nginx.conf
-
- # 修改内容如下:
- server {
- listen 9001;
- server_name localhost;
-
- location ~ /basketball/ {
- proxy_pass http://127.0.0.1:8080;
- }
-
- location ~ /football/ {
- proxy_pass http://127.0.0.1:8081;
- }
- }
-
- # 重新加载nginx配置
-
- ./nginx -s reload

- http://192.168.181.149:9001/basketball/index.html
-
- http://192.168.181.149:9001/football/index.html
-
