Install-free tomcat registration as a windows system service method, tomcat System Service
1. Download Tomcat
Tomcat can be downloaded from the http://tomcat.apache.org/web site. Select any region. The zip package under Binary Distributions is both.
2. Configure Tomcat
1. Unzip the decompressed version of tomcat to the corresponding path (for example, D: \ TomcatServer \ rename tomcat to Tomcat1)
2. If the server has multiple tomcat servers, you must modify the port in D: \ TomcatServers \ Tomcat1 \ conf \ server. xml.
<Server port="9071" shutdown="SHUTDOWN"><Connector port="9091" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="9061" /><Connector port="9081" protocol="AJP/1.3" redirectPort="9061" />
3. Modify the service. bat file (D: \ TomcatServers \ Tomcat1 \ bin \ service. bat). You can modify the file in two places.
①: Add the following settings at the beginning of the file: java installation path, Tomcat installation path, and service name
SET JAVA_HOME=D:\TomcatServers\Tomcat1\java\jdk1.6.0SET CATALINA_HOME=D:\TomcatServers\Tomcat1SET PR_DISPLAYNAME=Tomcat1
②: Find and modify the following content in the middle of the file
rem Set default Service nameset SERVICE_NAME=Tomcat7
Change
rem Set default Service nameset SERVICE_NAME=Tomcat1
4. Modify shutdown. bat and startup. bat file (D: \ TomcatServers \ Tomcat1 \ bin \ shutdown. bat | startup. bat) These two files are modified in the same way. Add the following content to the file header.
SET JAVA_HOME=D:\TomcatServers\Tomcat1\java\jdk1.6.0SET CATALINA_HOME=D:\TomcatServers\Tomcat1
III,
Add Tomcat to the service
Run Win + R to open the run dialog box, enter the cmd command to open the console, and follow the steps shown in the figure to complete registration.
Registered successfully
4. Uninstall the Tomcat Service