centOs 6.5 Configuration tomcat

Second, install Tomcat

1, download Tomcat

Download apache-tomcat-8.5.45.tar.gz (official website)

2, unzip Tomcat

#tar zxvf apache-tomcat-8.5.45.tar.gz

3, configure Tomcat

After extracting the files copied to the / opt directory

#mv apache-tomcat-8.5.45 /usr/local/apache-tomcat-8.5.45

Enter tomcat directory

#cd /usr/local/apache-tomcat-8.5.45

4, start Tomcat

# /usr/local/apache-tomcat-8.5.45/bin/startup.sh

Using CATALINA_BASE:  /usr/local/apache-tomcat-8.5.45

Using CATALINA_HOME:  /usr/local/apache-tomcat-8.5.45

Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.45/temp

Using JRE_HOME:        /usr/java/jdk1.8.0_131/jre

Using CLASSPATH:      /usr/local/apache-tomcat-8.5.45/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.45/bin/tomcat-juli.jar

Description above message has been successfully launched.

5, the firewall open port 8080

Increase in 8080 to the firewall configuration, do the following:

#/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

#service iptables save 

#service iptables restart

5. Verify that the configuration is successful

Open a browser and enter the URL: http: // localhost: 8080 or http://127.0.0.1:8080

On showing page configuration is successful!

6, close the Tomcat

# /usr/local/apache-tomcat-8.5.45/bin/shutdown.sh

7, automatically start Tomcat service

# echo '/usr/local/apache-tomcat-8.5.45/bin/startup.sh' >> /etc/rc.local

8, modify the server port number

If Tomcat default port 8080 conflict with other programs, you can modify the configuration file in ./conf/server.xml

For example: 8080 modified from the server port 9090

First, open the server configuration file ./conf/server.xml

#vim ./conf/server.xml

Find the Connector field configuration, as shown below, the default port is Port 8080

8080 to 9090 to modify the image above, save and exit


In this case, in order for the change to take effect, shut down and restart Tomcat service

#/usr/local/apache-tomcat-8.5.45/bin/shutdown.sh

#/usr/local/apache-tomcat-8.5.45/bin/startup.sh

Guess you like

Origin www.cnblogs.com/riyueqian/p/11489086.html