Linux (centOS7.6) install tomcat

1.  Download the tomcat  Linux installation package, address: http://tomcat.apache.org/download-80.cgi  , the version we downloaded is 8.0 , the download method is as shown in the figure:


2. Because the installation of tomcat depends on Java  JDK, it is necessary to first determine whether JDK is installed under the Linux system and configure environment variables

( 1 )   Enter the command: j ava  -version  If the JDK version number is displayed, it proves that the JDK has been installed.

( 2 )   Enter the command: echo $JAVA_HOME  If the path is displayed, it proves that the environment variable is configured.

If you enter the above two commands, if one of them is not displayed correctly, it proves that the installation is not successful or not configured, please refer to the following address for installation, http://blog.csdn.net/to_baidu/article/details/52821595 , as shown in the figure Shown: 


Put the decompressed tomcat on the server, here I choose the opt directory

3. Open permissions to tomcat first enter the opt file command: cd/opt


Enter the command: chmod -R 777 /opt/


The installation is complete!

4. Configure port 80 and domain name: Modify the service.xml file in conf under tomcat to change port 8080 to 80


Configure the domain name:


5. The firewall opens port 80 , first check whether the firewall has been started, command: firewall -cmd -state

If it is not enabled, use the command to enable the firewall

# open

service firewalld start

# restart

service firewalld restart

# closure

service firewalld stop

After opening the firewall

# Open port 80 firewall-cmd --permanent --add-port= 80 /tcp

Query whether the port is open firewall-cmd --query-port=80/tcp

#Restart the firewall (restart the firewall after modifying the configuration ) firewall-cmd --reload

1.  Start tomcat

(1)  Enter the directory cd / opt /tomcat/bin 

(2)  You can close ./shutdown.sh before starting 

(3)  Enter the command to start  ./startup.sh

(4)  The following picture appears successfully



Guess you like

Origin blog.csdn.net/qq_34128089/article/details/80634651