54powerman( [email protected] )
Configure JDK
1. Download jdk
After downloading, unzip it, assuming it is c:jdk1_4. Make sure the bin directory is in this directory. The following JAVA_HOME is this directory c:jdk1_4.
2. Configure system variables
(1) Right-click "My Computer", select "Properties" - "Advanced", and click "Environment Variables".
(2) In the "System Variables" box, click the "New" button, fill in "JAVA_HOME" for "Variable Name", and fill in the directory where the jdk is decompressed for the variable value.
Continue to add the CLASSPATH variable value as ".;%JAVA_HOME%libtool.jar;%JAVA_HOME%librt.jar;"
(3) Click the "New" button under the "User Variables" box, fill in "PATH" for "Variable Name", and fill in %PATH%;%JAVA_HOME%bin for "Variable Value";
2. Configure Tomcat
1. Download the Tomcat Zip compressed package and unzip it.
2. Modify the startup.bat file:
Add the following two lines before the first line -
SET JAVA_HOME=JDK directory
SET CATALINA_HOME=The directory of Tomcat after decompression before or %cd%
If you need to use shutdown.bat to shut down the server, add the two lines as above.
3. In this way, run startup.bat to run the server, and run shutdown.bat to shut down the server.
Third, Tomcat will be added to the service
1. Modify service.bat in the bin directory:
REM add the following line
set CATALINA_HOME=%cd%
If you have never installed Tomcat, or ensure that Services.msc starts the service manager to check that there is no Apache Tomcat system service, you can go to the second step at this point. Otherwise, keep going down--
REM Modify the following lines as described
set SERVICE_NAME=Tomcat5
REM In the above line, modify Tomcat5 to the service name you need. This will be the service name that will be operated later using net start/stop.
set PR_DISPLAYNAME=Apache Tomcat
REM The above line, Apache Tomcat changes to the display service name you need, this will be displayed in the service manager.
set PR_DESCRIPTION=Apache Tomcat Server - http://jakarta.apache.org/tomcat
It doesn't matter if the REM line is changed or not. It is a description of the service. Decide according to your own preferences.
2. Run cmd to open the console, enter the Tomat directory/bin folder, and enter the following command to run.
service.bat install
Program prompt: The service 'Tomcat5 (or your modified SERVICE_NAME)' has been installed
It means that the service Tomcat has been installed successfully.
By the way, the service can be removed by running service.bat remove.
3. At this point, the service is added successfully. Run services.msc and you can see the added service. By default, the service is run manually. In its properties, change the startup type to "automatic". After the machine starts, Tomcat starts in the background.
Four console control service commands to start the service
net Start service name closes the service
net stop service name note:
1 This service name can be SERVICE_NAME or PR_DISPLAYNAME;
2 If the service name contains spaces or Chinese characters, please enclose the service name in half-width double quotes.
Finally, I wish you a smooth first configuration.