- sed -i 's#8005#8006#g' tomcat_01/conf/server.xml
- sed -i 's#8009#8010#g' tomcat_01/conf/server.xml
- sed -i 's#8080#8081#g' tomcat_01/conf/server.xml
- sed -i 's#8005#8007#g' tomcat_02/conf/server.xml
- sed -i 's#8009#8011#g' tomcat_02/conf/server.xml
- sed -i 's#8080#8082#g' tomcat_02/conf/server.xml
- rm -rf /opt/tomcat_01/webapps/ROOT/*
- echo "tomcat_01" > /opt/tomcat_01/webapps/ROOT/index.html
- rm -rf /opt/tomcat_02/webapps/ROOT/*
- echo "tomcat_02" > /opt/tomcat_02/webapps/ROOT/index.html
- upstream java {
- server 192.168.8.5:8081;
- server 192.168.8.5:8082;
- }
- server {
- listen 80;
- server_name www.jpress.com;
- root html;
- index index.html index.htm;
- location / {
- proxy_pass http://java;
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
- }