This article uses software download address
(1) Windows 2000 Service Pack 3.exe download address:
http://download.microsoft.com/download/win2000platform/sp/sp3/nt5/enw2ksp3.exe
(2) J2SDK-1_4_1_02-windows-i586.exe download address:
http://java.sun.com/webapps/download/Redirect/32167382/5847479377282807053505607246086069333228071972022813600060132859339008063305596058473206-3865/j2sdk-1_4_1_02-windows-i586.exe
(3) JAKARTA-TOMCAT-4.1.18-le-jdk14.exe download address:
http://apache.linux process.net/dist/jakarta/tomcat-4/binaries/tomcat-4.1.18-le-jdk14.exe
(4) Apache_2.0.44-win32-x86-no_ssl.msi download address:
http://apache.linuxforum.net/dist/httpd/binaries/win32/apache_2.0.44-win32-x86-no_ssl.msi
(5) MOD_JK2-2.0.43.dll download address:
Http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/release/v2.0.1/bin/win32/mod_jk2-2.0.43.dll
Foreword: Use mod_jk2 to integrate Tomcat servers and Apache servers, simply.
First, install Windows 2000 Professional
After installed Windows 2000 Professional, it is highly recommended to install Windows 2000 Service Pack 3 because the latest JDK is installed under Windows 2000, you need to install Windows 2000 Service Pack 3 in advance.
Second, install JAVA's JDK (J2SDK-1_4_1_02-Windows-i586.exe)
When installing, according to the default directory: C: /J2SDK1.4.1_02, you need to set the system variable after the JDK installation is complete. Right-click "My Computer" on the desktop, click "Properties", select "Advanced", click "System Variable", do the following settings in "System Variable":
(1) Locate Path, click "Edit", only in the "variable value" last added: C: /J2SDK1.4.1_02/bin;
Then click "OK".
(2) Point "New", enter: ClassPath in "Variable Name"
Enter: C: /J2SDK1.4.1_02/lib/tools.jar;
Then click "OK", pay attention to the previous point, which represents the current directory, and you can go to any directory to execute the Java program in the directory.
Third, install Tomcat (Jakarta-Tomcat-4.1.18-Le-jdk14.exe)
Only change the installation directory during installation, set to C: / Tomcat 4.1, the rest is the default, password itself setting itself. After the Tomcat installation is complete, you also need to set the system variable, right-click "My Computer" on the desktop, click "Properties", select "Advanced", click "System Variable", do the following settings in "System Variable": (1) Click "New", enter: java_home in "Variable Name"
Enter: C: /J2SDK1.4.1_02 in Variable Value
Then click "OK" to save.
(2) Click "New", enter: Tomcat_home in "Variable Name"
Enter: C: / Tomcat 4.1 in "Variable Value"
Then click "OK" to save.
Fourth, test Tomcat
(1) Start the Tomcat server, click "Start Tomcat" in "Start" -> "Programs" -> "Apache Tomcat 4.1", do not turn off it), Tomcat servers start running .
(2) Enter http: // localhost: 8080 / after IE, see the top of Tomcat (with only a kitten above) indicates successful installation.
(3) Turn off the Tomcat server, "Stop Tomcat" in "Start" -> "Programs" -> "Apache Tomcat 4.1" (the "command prompt" window when the server is turned on automatically, the Tomcat server stops Run.
V. Establish a virtual directory
The Tomcat server has the default virtual directory (C: / Tomcat 4.1 / webapps), but we generally put it under the self-built folder when developing websites. If we want to turn the general folder into the virtual directory known, we need yourself. . Now introduce the method of configuring the Tomcat virtual directory:
(1) Establish a zgtt folder on the D disk, then make a simple JSP file under the folder (for testing), named index.jsp, the content is as follows:
hEAD>
<% OUT.PRINTLN ("Hello World!");%>
body>
html>
(2) Turn off the Tomcat server (see "IV, Test Tomcat" (3)).
(3) Under the C discharge, open the "Tomcat 4.1" folder, then open the subdirectory "conf" find the "server.xml" file, open it with Notepad and find " host>", in host > In front Add this code:
(4) Start the Tomcat server (see "IV, Test Tomcat" (1)). (5) After entering the http: // localhost: 8080 / zgtt / index.jsp link, if you see "Hello World!", It means that the virtual directory ZGTT is set successfully.
6. Install apache (apache_2.0.44-win32-x86-no_ssl.msi)
(1) Change the installation directory when installing, set to C: /.
(2) Parameter settings can beyed any value (note to fill in the format of the prompt).
(3) Modify a small error:
Apache2.0.44 has a small problem. After the default installation is successful, there is no index.html file in the HTDOCS directory under the home directory, we must rename index.html.en in this directory as index.html.
(4) Resolve the Chinese: Edit the configure file httpd.conf in editing the C: / Apache2 / Conf directory. Use Notepad to open it and find "AddDefaultCharset ISO-8859-1", comment out "AddDefaultCharset ISO-8859-1", ie before "#" characters before "" ". Then add the following three lines below "#adddefaultset ISO-8859-1":
AdddefaultCharset GB2312
DEFAULTLANGUAGE GB2312
AddLanguage EN-CN .CN
Seven, test Apache
After installing the Apache server, we need to test it and see if it is successful.
(1) Start Apache Server: Point "Start" -> "Program" -> "Apache Http Server 2.0.44" -> "Control Apache Server" -> "Monitor Apache Servers", if you see in the system "Turnd" The green small triangle appears on the feather icon of Apache. Then, the Apache server is successfully launched.
(2) After entering "http: // localhost" in IE, see the Apache's Apache home page indicates successful installation.
(3) Close the Apache server: Click the Apache icon in the system "Tow", select "STOP", if you see the red dot on the system "Tow" feathers. Then, the Apache server is successfully closed. .
Eight, integrate Apache Server and Tomcat Server
This is the most critical step, be sure to follow steps:
(1) Turn off the Apache server (see "Seven, Test Apache" (3)).
(2) Turn off the Tomcat server. (See "IV, Test Tomcat" (3)).
(3) Copy mod_jk2-2.0.43.dll to the C: / Apache2 / Modules subdirectory.
(4) Edit the configuration file httpd.conf in the C: / Apache2 / Conf directory. The last addition of this file
Count a few lines:
LoadModule JK2_Module Modules / MOD_JK2-2.0.43.DLL
ServerAdmin Webmaster@dummy-host.example.com
DocumentRoot "C: / Tomcat 4.1 / WebApps"
ServerName Dummy-Host.example.com
DirectoryIndex index.htm index.html index.jsperrorlog logs / dummy-host.example.com-error_log
Customlog logs / dummy-host.example.com-access_log Common
Virtualhost>
Note that DocumentRoot is consistent with your own Tomcat installation directory.
DirectoryIndex is a file that automatically explains the JSP type.
(5) Newly built a file in the C: / Apache2 / Conf directory, must be named Workers2.properties. The contents of workers2.properties are as follows:
[SHM]
File = $ {serverroot} /logs/shm.file
SIZE = 1048576
# Example Socket Channel, Override Port and Host.
[Channel.socket: Localhost: 8009]
Port = 8009
Host = 127.0.0.1
# Define the worker
[AJP13: Localhost: 8009]
Channel = CHANNEL.SOCKET: Localhost: 8009
# Uri mapping
[URI: / *]
Worker = ajp13: Localhost: 8009
Nine, test Apache servers and Tomcat server integration
(1) Start the APACHE server (see "7. Test Apache" in "7. Test Apache").
(2) Start the Tomcat server (see "4. Test Tomcat" in (1).
(3) Enter "http: // localhost: 8080 / zgtt / index.jsp" in IE. After the link, if "Hello World!" Is seen, it indicates that Tomcat starts successfully.
(4) Enter "http: //localhost/zgtt/index.jsp" in IE. After link, if you see "Hello World!" Again, the Apache server and Tomcat server are integrated successfully.