1. Tomcat directory structure
Tomcat is typically used for Java applications, and Apache is typically used for PHP
Bin folder (startup file):
Configuration monitoring and the like is in the catalina.sh
Conf folder (config file):
2, server.xml configuration file description
<server port= "8005" shutdown= "shutdown" >→shutdown command port number
<connector port= "8080" protocol= "http/1.1" → The port number of the connection is 8080
connectiontimeout= "20000" → connection time-out 20s
redirectport= "8443"/>
<executor name= "Tomcatthreadpool" nameprefix= "catalina-exec-" → set up the tomcat thread pool
Maxthreads= "minsparethreads=" 4 "/>
<connector executor= "Tomcatthreadpool" → introducing the tomcat thread pool
port= "8080" protocol= "http/1.1"
connectiontimeout= "20000"
redirectport= "8443"/>
<engine name= "Catalina" defaulthost= "localhost" >→ engine name
Unpackwars= "true" autodeploy= "true" >
3, tomcat-users.xml configuration file description
Start Tomcat
[Email protected] bin]# pwd
/usr/local/myfiles/apache-tomcat-8.5.15/bin
[Email protected] bin]# sh startup.sh && tail-f. /logs/catalina.out
Such as:
Click Server Status:
In the tomcat-users.xml in the/usr/local/myfiles/apache-tomcat-8.5.15/conf directory, add:
<role rolename= "Manager-gui"/><user username= "Tomcat" password= "S3cret" roles= "Manager-gui"/>
Restart Tomcat, Access http://192.168.20.129:8080/
Log on to the Server Status page to monitor the state of the JVM and the thread pool:
http-bio-8080 Bar (thread state):
Max thread→ Max Threads
Processing time→ Total processing time
P: Waiting request, equivalent to waiting status
S: Working status
F: Completion status
R: Ready state
K: Long Connection
Web Container (*): Tomcat configuration Monitoring