In the Tomcat installation directory,conf stores the global configuration of the Tomcat server, including tomcat-users. XML, server. XML, and web. XML.

Tomcat – users. The XML configuration

One: Tomcat6 Configures the administrator information

1: Open the /conf/tomcat-users. XML file under Tomcat6. The information about user roles and administrators is contained in this configuration file.

2: Add the following XML to the tomcat-Users > configuration file

<role rolename="admin"/>
<role rolename="manager"/>
<user username="admin" password="admin" roles="admin,manager"/>
Copy the code

3: Start tomat6, enter: user name :admin Password :admin Log in to the administrator interface.

 

Two: Tomcat7 Configures administrator information

1: Open the /conf/tomcat-users. XML file under Tomcat7. Information about user roles and administrators are contained in the file.

2: Add the following XML to the tomcat-Users > configuration file

<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="manager-gui"/>
Copy the code

3: Start tomat7, enter: user name :admin Password :admin log in to the administrator interface.

 

Server.xml configuration

<Connector port="8080" protocol="HTTP/1.1"   
           connectionTimeout="20000"   
           redirectPort="8443" acceptCount="500" maxThreads="400" />  
Copy the code

OnnectionTimeout is in milliseconds. The default is 20 seconds. By modifying this parameter, you can modify the tomcat request timeout period.

To change the maximum number of concurrent connections, you need to change the maxThreads and acceptCount parameters. The default values of these two parameters are 200 and 100 respectively. To adjust the default maximum number of connections for Tomcat, you can increase the values of these two attributes. Make acceptCount greater than or equal to maxThreads.

About me: A network security enthusiast, dedicated to sharing original high-quality dry goods, welcome to follow my personal wechat public account: Bypass–, browse more wonderful articles.