The software version used in this article is as follows:
Download the installation and configuration of the JDK, and refer to the detailed steps for installing the JDK on Linux on the previous blog post.
Installation of Tomcat
Generate links for version upgrades
# ln-s apache-tomcat-7.0.52 Server
Open the firewall to allow external access
#/sbin/iptables-i input-p TCP--dport 8080-j ACCEPT
# Service Iptables Save
# Service Iptables Restart
Select startup.sh from the configuration file to start Tomcat
[[email protected] bin]#./startup.sh
Using catalina_base: /usr/local/tomcat/apache-tomcat-7.0.52
Using catalina_home: /usr/local/tomcat/ apache-tomcat-7.0.52
Using JRE_HOME: /usr/lib/jvm/jdk1.8.0_131
Using classpath: /usr/local/tomcat/apache-tomcat-7.0.52/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-7.0.52/ Bin/tomcat-juli.jar
View the IP address of this computer to see if it has been started
[Email protected] bin]# ifconfig
Eth0 Link encap:ethernet HWaddr 00:0c:29:e7:f5:09
inet addr:192.168.1.104 bcast:192.168.1.255 mask:255.255.255.0
In the browser input: http://192.168.1.104:8080
The page that appears Tomcat indicates that the installation was successful.
Configuring the Web Access port
You can modify the file Server.xml in the Conf directory, modify the connector element (the default port for Tomcat is 8080) and need to restart the Tomcat service to take effect.
<connector port= "protocol=" http/1.1 "connectiontimeout=" 20000 "redirectport=" 8443 "/>
Tomcat directory structure
bin //Command script file hosting Tomcat
conf // Various configuration files for the Tomcat server, most notably Server.xml
lib //store Tomcat Server support jar package
Logs //storing log files
temp //storing temporary files
WebApps//web the directory in which the application resides, Directory for external access to Web resources
work //tomcat working directory
Directory structure for Web Apps
WebApp--The directory where the Web application resides
|---html, JSP, CSS, JS files, etc.-these files are generally in the root directory of the Web application, the files under the root directory can be directly accessed by the outside world.
|---web-inf directory-java classes, JAR packages, Web configuration files exist in this directory, the outside world is not directly accessible, the WEB server is responsible for the call.
|---Classes Directory--Java class
|---lib directory--the jar package required for Java classes to run
|---web. xml file--configuration file
This article is from the "xinsz08の parallel space-time" blog, be sure to keep this source http://xinsz08.blog.51cto.com/10565212/1949149
Installing Tomcat on Linux