Demand:
You need to deploy my own project on a Linux server that already has a project deployed, without interfering with it.
Solve:
There are two ways of doing this:
① a server to publish multiple projects
② multiple servers are published separately
The second method is described here.
Multiple Tomcat publish items separately
Steps:
★ Download Tomcat extracted into multiple folders for use, such as here will be tomcat download to/opt under the name of decompression
TAR-ZXVF apache-tomcat-7.0.75.tar.gz
MV apache-tomcat-7.0.75 tomcat-8070
Repeat the above decompression rename step, add multiple tomcat, roughly as follows:
[root@vastio138 opt]# ls
apache-tomcat-7.0.75.tar.gz tomcat-8080
tomcat-8090 tomcat-8070
★ Modify the Config/service.xml files under each Tomcat directory separately
The following three ports are modified in Service.xml: (Vim can use/make a search to modify)
Ensure that the modified port number is not duplicated;
Also, if the firewall is turned on (service iptables Status View), you will need to modify the firewall configuration (CentOS 6.5) to add Tomcat's port number to the configuration file:
Use (YY copy existing port number row, then p paste, last I modify port number)
[root@vastio138/]# vim/etc/sysconfig/iptables
# Firewall configuration written by System-config-firewall
# Manual customization of this file is not recommended.
*filter
: INPUT ACCEPT [0:0]
: FORWARD ACCEPT [0:0]
: OUTPUT ACCEPT [0:0]
-A input-m State--state Establis Hed,related-j ACCEPT
-a input-p icmp-j ACCEPT-a
input-i lo-j ACCEPT
-a input-m state--state new-m TCP -P TCP--dport 22-j ACCEPT
-a input-m state--state new-m tcp-p TCP--dport 1521-j ACCEPT
-a input-m stat E--state new-m tcp-p tcp--dport 8070-j ACCEPT
-A input-m State--state new-m tcp-p TCP--dport 8080-j ACCEPT
-a input-m state--state new-m tcp-p TCP--dport 8090-j ACCEPT
-a input-j REJECT--reject-with icmp-host-p rohibited
-A forward-j REJECT--reject-with icmp-host-prohibited
COMMIT
~
Or close the firewall directly: service iptables stop