1, first, pause the iptables service
[[Email protected] ~]# service iptables stop
[Email protected] ~]# chkconfig iptables off
Installation and configuration of 2,JDK:
(1), install JDK command: RPM-IVH jdk-8u51-linux-x64.rpm
[[Email protected] install]# lltotal 481168-rw-r--r--. 1 root root 8850470 nov 2 22:43 apache-tomcat-7.0.63.tar.gz-rw-r--r--. 1 Root root 137808216 jan 13 15:09 jdk-8u51-linux-x64.rpm-rw-r--r--. 1 Root root 33203321 nov 20 11:31 mysql-5.6.25.tar.gz-rw-r--r--. 1 root root 312845162 nov 13 15:19 mysql-5.6.27-linux-glibc2.5-x86_64.tar.gz [[email protected] install]# rpm -ivh jdk-8u51-linux-x64.rpm preparing... #################### ####################### [100%] 1:jdk1.8.0_51 ########################################### [100%]Unpacking JAR Files... rt.jar... jsse.jar... charsets.jar... tools.jar... localedata.jar... jfxrt.jar... plugin.jar... javaws.jar... deploy.jar ...
(2) Configure environment variables:
[[Email protected] install]# vi /etc/profile# /etc/profile# system wide environment and startup programs, for login setup# functions and aliases go in /etc/bashrc# it ' s not a good idea to Change this file unless you know what you# are doing. it ' s much better to create a custom.sh shell script in# /etc/ profile.d/ to make custom changes to your environment, as this# will prevent the need for merging in future updates.pathmunge () { case ": ${path}:" in *: "$":*) ;; *) if [ "$" = " After " ] ; then path= $PATH: $1 else path=$1: $PATH             FI    ESAC} "/etc/ Profile " 78l, 1796c# by default, we want umask to get set. this sets it for login shell# current threshold for system reserved uid/gids is 200# you could check uidgid reservation validity in# /usr/share/doc/setup-*/uidgid fileif [ $UID -gt 199 ] && [&nBSP; " ' Id -gn ' = ' Id -un ' ]; then umask 002else umask 022fifor i in /etc/profile.d/*.sh ; do if [ -r "$i" ]; then if [ "${-#*i}" != "$-" ]; then . "$i" else . "$i" >/dev/null 2>&1 fi fidoneunset iunset -f Pathmungeexport java_home=/usr/java/jdk1.8.0_51export path= $JAVA _home/bin: $PATHexport classpath = $JAVA _home/lib:.: $CLASSPATH
(3) Test:
View Java version number: Java-version
[[email protected] install]# Java-versionjava version "1.8.0_51" Java (TM) SE Runtime Environment (build 1.8.0_51-b16) Java HotSpot (TM) 64-bit Server VM (build 25.51-b03, Mixed mode)
View Javac Version number command: Javac-version
[Email protected] install]# Javac-versionjavac 1.8.0_51
3,tomcat installation Configuration
(1), create group and user Tomcat
[[email protected] install]# groupadd tomcat[[email protected] install]# useradd-g tomcat Tomcat[[email protected] instal l]# passwd tomcatchanging password for user tomcat. New Password:bad Password:it is too Simplistic/systematicbad password:is too simpleretype new Password:passwd:all aut Hentication Tokens updated successfully. [Email protected] install]#
(2) switch users and create a directory for Tomcat users:
[email protected] install]# su tomcat[[email protected] install]$ mkdir/home/tomcat/server [[email protected] install]$
(3) Unzip the Tomcat package and place it in the specified directory
[[email protected] install]$ tar zxvf apache-tomcat-7.0.63.tar.gz -c /home/ tomcat/server/apache-tomcat-7.0.63/webapps/examples/jsp/xml/xml.jsp.htmlapache-tomcat-7.0.63/webapps/examples/ servlets/chat/index.jspapache-tomcat-7.0.63/webapps/examples/servlets/chat/index.jsp.htmlapache-tomcat-7.0.63/ webapps/examples/servlets/chat/login.jspapache-tomcat-7.0.63/webapps/examples/servlets/chat/ login.jsp.htmlapache-tomcat-7.0.63/webapps/examples/servlets/chat/post.jspapache-tomcat-7.0.63/webapps/ examples/servlets/chat/post.jsp.htmlapache-tomcat-7.0.63/webapps/examples/servlets/ cookies.htmlapache-tomcat-7.0.63/webapps/examples/servlets/helloworld.htmlapache-tomcat-7.0.63/webapps/ examples/servlets/images/code.gifapache-tomcat-7.0.63/webapps/examples/servlets/images/ execute.gifapache-tomcat-7.0.63/webapps/examples/servlets/images/return.gifapache-tomcat-7.0.63/webapps/ Examples/servlets/index.htmlapache-tomcat-7.0.63/webapps/examples/servlets/reqheaders.htmlapache-tomcat-7.0.63/webapps/examples/servlets/reqinfo.htmlapache-tomcat-7.0.63/webapps/examples/servlets/ reqparams.htmlapache-tomcat-7.0.63/webapps/examples/servlets/sessions.htmlapache-tomcat-7.0.63/webapps/ examples/websocket-deprecated/chat.htmlapache-tomcat-7.0.63/webapps/examples/websocket-deprecated/ echo.htmlapache-tomcat-7.0.63/webapps/examples/websocket-deprecated/index.htmlapache-tomcat-7.0.63/webapps/ examples/websocket-deprecated/snake.htmlapache-tomcat-7.0.63/webapps/examples/websocket/ Chat.xhtmlapache-tomcat-7.0.63/webapps/examples/websocket/drawboard.xhtmlapache-tomcat-7.0.63/webapps/examples /websocket/echo.xhtmlapache-tomcat-7.0.63/webapps/examples/websocket/index.xhtmlapache-tomcat-7.0.63/webapps/ examples/websocket/snake.xhtmlapache-tomcat-7.0.63/webapps/host-manager/meta-inf/ context.xmlapache-tomcat-7.0.63/webapps/host-manager/web-inf/jsp/401.jspapache-tomcat-7.0.63/webapps/ Host-manager/web-inf/jsp/403.jspapache-tomcat-7.0.63/webapps/host-manager/web-inf/jsp/404.jspapache-tomcat-7.0.63/webapps/host-manager/web-inf/web.xmlapache-tomcat-7.0.63/webapps/host-manager/images/ add.gifapache-tomcat-7.0.63/webapps/host-manager/images/asf-logo.gifapache-tomcat-7.0.63/webapps/host-manager/ images/code.gifapache-tomcat-7.0.63/webapps/host-manager/images/design.gifapache-tomcat-7.0.63/webapps/ host-manager/images/docs.gifapache-tomcat-7.0.63/webapps/host-manager/images/fix.gifapache-tomcat-7.0.63/ webapps/host-manager/images/tomcat.gifapache-tomcat-7.0.63/webapps/host-manager/images/ update.gifapache-tomcat-7.0.63/webapps/host-manager/images/void.gifapache-tomcat-7.0.63/webapps/host-manager/ index.jspapache-tomcat-7.0.63/webapps/host-manager/manager.xmlapache-tomcat-7.0.63/webapps/manager/meta-inf/ context.xmlapache-tomcat-7.0.63/webapps/manager/web-inf/jsp/401.jspapache-tomcat-7.0.63/webapps/manager/ web-inf/jsp/403.jspapache-tomcat-7.0.63/webapps/manager/web-inf/jsp/404.jspapache-tomcat-7.0.63/webapps/ Manager/web-inf/jsp/sessiondetail.jspapache-tomcat-7.0.63/webapps/manager/web-inf/jsp/sessionslist.jspapache-tomcat-7.0.63/webapps/manager/web-inf/web.xmlapache-tomcat-7.0.63/webapps/ manager/images/add.gifapache-tomcat-7.0.63/webapps/manager/images/asf-logo.gifapache-tomcat-7.0.63/webapps/ manager/images/code.gifapache-tomcat-7.0.63/webapps/manager/images/design.gifapache-tomcat-7.0.63/webapps/ Manager/images/docs.gifapache-tomcat-7.0.63/webapps/manager/images/fix.gifapache-tomcat-7.0.63/webapps/manager /images/tomcat.gifapache-tomcat-7.0.63/webapps/manager/images/update.gifapache-tomcat-7.0.63/webapps/manager/ images/void.gifapache-tomcat-7.0.63/webapps/manager/index.jspapache-tomcat-7.0.63/webapps/manager/ Status.xsdapache-tomcat-7.0.63/webapps/manager/xform.xsl
(4) switch directory and config file:
[[email protected] install]$ Cd/home/tomcat/server/apache-tomcat-7.0.63/conf/[[email protected] conf]$ CP Server.xml Server.xml.bak[[email protected] conf]$ VI server.xml
(5) Start off Test
[[Email protected] bin]$ /home/tomcat/server/tomcat/bin/startup.shusing catalina_base: /home/tomcat/server/apache-tomcat-7.0.63using catalina_home: /home/ tomcat/server/apache-tomcat-7.0.63using catalina_tmpdir: /home/tomcat/server/apache-tomcat-7.0.63/ tempusing jre_home: /usrusing classpath: /home/tomcat/server/apache-tomcat-7.0.63/bin/bootstrap.jar:/home/tomcat/server/ Apache-tomcat-7.0.63/bin/tomcat-juli.jartomcat started. [[email protected] bin]$ ps -ef|grep tomcaroot 1535 1102 0 15:24 pts/0 00:00:00 su tomcattomcat 1536 1535 0 15:24 pts/0 00:00:00 bashtomcat 1568 1 30 15:31 pts/0 00:00:02 /usr/bin/java - djava.util.logging.config.file=/home/tomcat/server/apache-tomcat-7.0.63/conf/logging.properties - Djava.util.logging.manager=org.apache.juli.classloaderlogmanager -djava.endorsed.dirs=/home/tomcat/server /apache-tomcat-7.0.63/endorsed -classpath /home/tomcat/server/apache-tomcat-7.0.63/bin/bootstrap.jar :/home/tomcat/server/apache-tomcat-7.0.63/bin/tomcat-juli.jar -dcatalina.base=/home/tomcat/server/ Apache-tomcat-7.0.63 -dcatalina.home=/home/tomcat/server/apache-tomcat-7.0.63 -djava.io.tmpdir=/home /tomcat/server/apache-tomcat-7.0.63/temp org.apache.catalina.startup.bootstrap starttomcat 1586 1536 4 15:31 pts/0 00:00:00 ps -eftomcat 1587 1536 0 15:31 pts/0 00:00:00 grep tomca[[email protected] bin]$ netstat -lntp |grep 8080 (not all processes Could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 :::8080 :::* listen 1568/java
This article is from the "Breght Moon" blog, make sure to keep this source http://liqingbiao.blog.51cto.com/3044896/1734612
Installing the configuration JDK and Tomcat