I have learned java before... however, it is only a language field, but it has not been used to configure the Java Runtime Environment (because JBuilder was used at the time, it itself had a virtual machine to run ). over the past few days, I have relived Java and solved the problem of not configuring tomcat in the past.
Configure Tomcat 5:
Work environment:
Win XP
Prerequisites:
- Install JDK (I installed JDK 1.4.2 _ 03 and the installation directory is C:/j2sdk1.4.2 _ 03)
- Install Tomcat 5 (I decompress the package installation method and decompress Tomcat 5 content to: F:/tomcat5. Because of the package installation method, the following manual configurations are required)
Method:
- Add system environment variables. The environment variables to be set include:
- Classpath:.; C:/j2sdk1.4.2 _ 03/lib/tools. Jar
- Path:(Same as the path value of the system variable); C:/j2sdk1.4.2 _ 03/bin
- Java_home: C:/j2sdk1.4.2 _ 03
- Tomcat_home: F:/tomcat5
- Start Tomcat. tomcat installation directory: F:/tomcat5/bin contains a startup. Bat command to start the Tomcat runtime service. shutdown. bat is the end service.
- Test site configuration. Open F:/tomcat5/CONF/server. xml and find the following content:
========================================================== ========================================================== ==============
<! -- Define a non-SSL coyote HTTP/1.1 Connector on port 8080 -->
<ConnectorPort = "8080"
Maxthreads = "150" minsparethreads = "25" maxsparethreads = "75"
Enablelookups = "false" redirectport = "8443" acceptcount = "100"
DEBUG = "0" connectiontimeout = "20000"
Disableuploadtimeout = "true"/>
========================================================== ========================================================== ==============
It can be seen that connector is a Web service connection for non-ssl http 1.1 Access. The attribute port is the access port, and the other attribute is to configure some HTTP access parameters:
========================================================== ========================================================== ==============
<HostName = "localhost" DEBUG = "0" appbase = "webapps"
Unpackwars = "true" autodeploy = "true"
Xmlvalidation = "false" xmlnamespaceaware = "false">
========================================================== ========================================================== ==============
Host is the Server property of the Web application, and others are most concerned with the appbase property. It specifies the physical location of the Web application on the Web server, such as your program in C: /jsp directory, you can change the value of appbase to C:/jsp
As a result, Tomcat is configured. When running JSP/servlet (Java) web application, you only need to execute startup. BAT to run the Java Virtual Machine.