Simple deployment of the Tomcat environment

Source: Internet
Author: User

1. Uninstalling the JDK

Rpm-qa|grep Java

RPM-E--nodeps need to unload the package

2. Install the required RPM package

RPM-IVH installation Package

3. Unzip Tomcat and set the port to modify the open port, listening port, and shutdown port

4. Configure the required memory

java_opts= '-xms1024m-xmx8196m '

5. Configure boot entry (CENTOS6, 7 all applicable)

Vi/etc/inin.d/webxxx

#!/bin/sh

# Webmpos:start/stop/restart Webmpos

# chkconfig:2345 60 50

# Description:tomcat is a Java Servlet Container

# Match these values to your environment:

Export Catalina_base=/app/web/mpos

Export Catalina_home=/app/web/mpos

Export Catalina_tmpdir=/app/web/mpos/temp

Export JRE_HOME=/USR

# Source function library.

. /etc/init.d/functions Tomcat=/app/web/mpos

Start () {

Echo-n "Starting Tomcat:"

#/root/rc.local start

/app/web/mpos/bin/startup.sh start

}

Stop () {

Echo-n "Stopping Tomcat:"

/app/web/mpos/bin/shutdown.sh stop

}

# See how we were called.

Case "$" in

Start

Start

;;

Stop

Stop

;;

Status

;;

Restart

Stop

Sleep 2

Start

;;

*)

echo "Usage: $ {Start stop restart}";

Esac

Exit $RETVAL



Chkconfig webxxx on

6. Configuring firewalls, listening ports

Centos6

Vi/etc/sysconfig/iptables

-A input-m state--state new-m tcp-p TCP--dport 8080-j ACCEPT

Centos7

Firewall-cmd--zone=public--add-port=8081/tcp--permanent

Systemctl Restart Firewalld


This article is from "Drip, happiness" blog, please be sure to keep this source http://fengm.blog.51cto.com/1429593/1891231

Simple deployment of the Tomcat environment

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.