Tomcat installation and configuration (Linux systems)

Environment Description: Linux environment, CentOS 7 version.

Step One: Download tomcat version, download address: https://tomcat.apache.org/index.html

 

I use the end of the zip package

Unzip command: 
the unzip suffix ending XX.zip #zip results are as follows:
[root @ localhost the Apache-Tomcat] # LS
the Apache-Tomcat-9.0.20 apache-tomcat-9.0.20.zip

Step two: modify the configuration file

Modify the access port number:

 The third step: start tomcat.

By looking at the file [RUNNING.txt], you can see, Linux systems and Window systems start tomcat is different, as follows:

(4) Start Up Tomcat

(4.1) Tomcat can be started by executing one of the following commands:
On Windows:
%CATALINA_HOME%\bin\startup.bat or %CATALINA_HOME%\bin\catalina.bat start
On
*nix: $CATALINA_HOME/bin/startup.sh or $CATALINA_HOME/bin/catalina.sh start (4.2) After startup, the default web applications included with Tomcat will be available by visiting: http://localhost:8080/ (4.3) Further information about configuring and running Tomcat can be found in the documentation included here, as well as on the Tomcat web site: https://tomcat.apache.org/ (5) Shut Down Tomcat (5.1) Tomcat can be shut down by executing one of the following commands: On Windows: %CATALINA_HOME%\bin\shutdown.bat or %CATALINA_HOME%\bin\catalina.bat stop On *nix: $CATALINA_HOME/bin/shutdown.sh or $CATALINA_HOME/bin/catalina.sh stop

第四步:访问tomcat

The default local access address is: http: // localhost: 8080 /, when the other machine, localhost will be replaced by their corresponding IP numbers on it (default port is 8080, if looking from another port number, also need to be replaced next!)

 

Other: Sometimes other computer access, display a blank screen may be a firewall restrictions, add a firewall ports are as follows:

[root @ localhost conf] # cd / etc / sysconfig 
[root @ localhost sysconfig] # Firewall -cmd --zone = public --add-Port = 8080 / tcp - Permanent # Add port 8080, the default port for the tomcat 
success 

command meaning: 
-zone # scope 
-add -port = 80 / tcp # Add port, the format is: port / protocol 
-permanent # permanent, this argument does not restart after failure
firewall-cmd --reload #重启firewall

 

Guess you like

Origin www.cnblogs.com/lelelong/p/10252225.html