Tomcat relies on the JDK package, so the JDK is configured first.
After the configuration is complete, unzip the downloaded Tomcat to/usr/local
TAR-XVF apache-tomcat-7.0.70.tar.gz-c/usr/local
Configuring Environment variables
Edit vim/etc/profile.d/tomcat.sh
Add two lines:
Export Catalina_home=/usr/local/apache-tomcat-7.0.70export path= $PATH: $CATALINA _home/bin
Let the system read the configuration file
source/etc/profile.d/tomcat.sh
Then test to see if the installation was successful:
catalina.sh version
The Start command is:
catalina.sh start
Can be used after startup
JPs
command to view
###################################################################################################
Note that in the/etc/hosts file, there is a problem with the 127.0.0.1 line, otherwise the startup fails, such as the following error in the log
Finally causes the process to close
Java.net.BindException:Cannot Assign requested Address
At Java.net.PlainSocketImpl.socketBind (Native Method)
At Java.net.PlainSocketImpl.bind (plainsocketimpl.java:383)
At Java.net.ServerSocket.bind (serversocket.java:328)
At Java.net.serversocket.<init> (serversocket.java:194)
At Org.apache.catalina.core.StandardServer.await (standardserver.java:444)
At Org.apache.catalina.startup.Catalina.await (catalina.java:781)
At Org.apache.catalina.startup.Catalina.start (catalina.java:727)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:39)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:25)
At Java.lang.reflect.Method.invoke (method.java:597)
At Org.apache.catalina.startup.Bootstrap.start (bootstrap.java:294)
At Org.apache.catalina.startup.Bootstrap.main (bootstrap.java:428)
2:43:08 AM Org.apache.coyote.AbstractProtocol Pause
Info:pausing Protocolhandler ["http-bio-8080"]
2:43:10 AM Org.apache.coyote.AbstractProtocol Pause
Info:pausing Protocolhandler ["ajp-bio-8009"]
2:43:12 AM Org.apache.catalina.core.StandardService stopinternal
Info:stopping Service Catalina
2:43:12 AM Org.apache.coyote.AbstractProtocol Stop
Info:stopping Protocolhandler ["http-bio-8080"]
2:43:14 AM Org.apache.coyote.AbstractProtocol Stop
Info:stopping Protocolhandler ["ajp-bio-8009"]
2:43:16 AM Org.apache.coyote.AbstractProtocol Destroy
Info:destroying Protocolhandler ["http-bio-8080"]
Tomcat Linux Installation