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