Multiple Tomcat deployment projects on "Tomcat" Linux __linux

Source: Internet
Author: User
Tags iptables

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.