You can find the Startup.bat file in the installation directory bin directory. Add the following three lines after Rem Guess Catalina_Home if not defined: set java_home = d: / java / jdk set tomcat_home = d: / apache / tomcat5 set catalina_home = d: / apache / tomcat5
Note The present example assumes that the JDK is installed in the D: / Java / JDK directory, Tomact5.019 is installed in the D: / Apache / Tomcat5 directory.
============================================================================================================================================================================================================= ============================
The following is a more detailed explanation
============================================================================================================================================================================================================= ============================
Apache Tomcat server configuration basis
When we learn servlet and JSP technology, in order to facilitate the convenience, we always hope that there is a desktop on your desktop, while Tomcat is slightly troublesome than other commercial servers, but it is not only completely Free, you can get its complete source code and is compatible with the latest servlets and JSP specifications.
Download address: http://jakarta.apache.org/tomcat/ (currently the latest version is 5.0, this article is described as an example of Tomcat4.1.30)
Note: Because the Servlet API and JSP API require Java 2 platform, it is recommended to install JDK (currently the latest version of 1.5 Beta 1, the relevant configuration of environment variables] This forum has been introduced, and details will not be described here)
Installation:
In Tomcat's official website, you can download two types of installation files. EXE and .ZIP, .. Zip file You only need to decompress, and .exe installation file After you installed, start up at each boot Automatically run the server, this will
Leading to the initiator configuration, if you need to manually start the Tomcat server, it is best to download the .zip file (if it is .exe file, take XP as an example: Start -) Control Panel -> Management Tool -> Service -> To the service named Apache Tomcat 4.1, change the automatic manual) Configuration:
In the environment variable, add the following variables:
The following example is installed in C: / J2SDK14, Tomcat installed in the D: / Tomcat4 directory, and the operation is based on specific installation paths:
Java_Home = C: / J2SDK14 CATALINA_HOME = C: / Tomcat4 // Some users reflect the 4.1 version of the above to use Catalina_home instead of Tomcat_home can be successfully configured, leave a reference to you Tomcat_Home = C: / Tomcat4 path = C: / J2SDK14 / BIN ClassPath = .; c: /j2sdk14/lib/tools.jar; c: /j2sdk14/lib/dt.jar ;; D: / Tomcat4 / lib; d: /tomcat4/common/lib/servlet.jar / / Configure the last one and pay attention to "." The symbol should not miss it. He represents the current directory.
In this way, the configuration of the environment variable is completed, enter the Tomcat4 / bin folder, double-click Startup.exe, the console will appear on the desktop, and list some related information, if the console is not flashing, always stay On the desktop, then I want to congratulate you ~~ Configure success :)
Enter: http:// localhost '> http:// localhost: 8080 or http://127.0.0.1:8080, you will see a lovely don't know what the tiger is still a cat. PS: Since it is Tomcat, it should be a cat :) Haha
Let's take a fun JSP page to test:
code show as below:
<% @ page language = "java"%> <% @ page import = "java.util.date"%>
Save to Refresh.jsp Under C: / Tomcat4 / WebApps / Root, then http: // localhost '> http:// localhost: 8080 / refresh.jsp, you will see a second automatic refresh page.
Hurry up your "Kitten" into your Tomcat journey :)