-------------------------------------------------- ------------- Win2000 Professional System Integrated Tomcat Server and Apache Server ZGTT (Original) Keyword Integration, Virtual Directory This article Using Software Download Address (1) Windows 2000 Service Pack 3.exe Download Address: http://download.microsoft.com/download/WIN2000PLATFORM/SP3.EXE (2) J2SDK-1_4_1_02-windows-i586.exe download address: http: //java.sun. http:: //apache.linuxforum com / webapps / download / Redirect / 32167382 / 5847479377282807053505607246086069333228071972022813600060132859339008063305596058473206-3865 / j2sdk-1_4_1_02-windows-i586.exe (3) jakarta-tomcat-4.1.18-LE-jdk14.exe address to download. 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 Preface: Use mod_jk2 to integrate Tomcat service Worker and Apache servers, simple. First, after installing Windows 2000 Professional After installation of Windows 2000 Professional, it is highly recommended to install Windows 2000 Service Pack 3 because the latest JDK is installed in Windows 2000, you need to install Windows 2000 Service Pack 3 in advance. Second, install the JAVA JDK (J2SDK-1_4_1_02-Windows-i586.exe) follow the default directory: c: /j2sdk1.4.1_02, the system variable needs to be set after the JDK installation is completed. Right-click "My Computer" on the desktop, click "Properties", select "Advanced", click "System Variable", do the following settings in "System Variable": (1) Find PATH, click "Edit", only The last added in "Variable Value": C: /J2SDK1.4.1_02/bin; then "OK".
(2) Click "New", enter in "Variable Name": ClassPath Enter:.; C: /J2SDK1.4.1_02/lib/tools.jar; then click "OK", pay attention to the previous one Point, it represents the current directory, after the directory, you can go to any directory to perform the Java program that requires a certain class in the directory. Third, install Tomcat (jakarta-tomcat-4.1.18-le-jdk14.exe) only change the installation directory, 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", entered in "Variable Name": Java_home Enter: C: /J2SDK1.4.1_02 and save it in "OK" in "Variable Name". (2) Point "New", enter: Tomcat_home in "Variable Name" Enter: C: / Tomcat 4.1 and click "OK" to save. Fourth, Test Tomcat (1) Start Tomcat Server, "Start Tomcat" in "Start" -> "Programs" -> "Apache Tomcat 4.1" (A "Command Prompt" window, do not turn off it), Tomcat server I started to run. (2) Enter http: // localhost: 8080 / after IE, see the top of Tomcat (with only a kitten above) indicates successful installation. (3) Close the Tomcat server, click "Stop Tomcat" in "Start" -> "Programs" -> "Apache Tomcat 4.1" command prompts
The window is automatically turned off), the Tomcat server stops running. 5. Establishing the virtual directory Tomcat server has the default virtual directory (C: / Tomcat 4.1 / webapps), but we generally put it in the self-built folder when we develop a website. Next, if you want to put it
The folder turns into a virtual directory known to Tomcat, and we need yourself. Now introduce the method of configuring the Tomcat virtual directory: (1) Establish the zgtt folder in the D disk, then make a simple JSP file (for test) under the folder, named index.jsp, the content is as follows:
CrossContext = "true"> context> and save the file. (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 Apache2 home, we must use this directory.
The down index.html.en is renamed as index.html. (4) Resolve the Chinese: Edit the configure file httpd.conf in editing the C: / Apache2 / Conf directory. Open it with Notepad and find "AddDefaultcharset
ISO-8859-1, comment out "AddDefaultCharset ISO-8859-1", ie, add a "#" character before "AddDefaultCharset ISO-8859-1".
Then add the following three lines in "#adddefaultcharset ISO-8859-1": adddefaultcharset GB2312 DEFAULTLANGUAGE GB2312 ADDLANGUAGUAGUAGE GB2312 AddLAGUAGUAGUAGUE GB2312 AddLAGUAGUGUAGUGE GB2312 AddLAGUAGUE EN. CN Seven, Test Apache After installing the Apache server, we need to test it to 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) Turn off the Apache server: Click the Apache icon in the System "Tow", select "Stop", if you see red on the system "Dilast", you can see red on the feathers icon of Apache.
A dot. The Apache server is successfully closed. Eight, integrated Apache servers and Tomcat servers This is the most critical step. Be sure to configure it carefully: (1) Turn off the Apache server (see "Seven, Test Apache" in (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. At the end of this file add the following lines: LoadModule jk2_module modules / mod_jk2-2.0.43.dll
After link, if you see "Hello World!" Again, the Apache server and Tomcat server are integrated successfully. Note: Then install it. (My installation in g: / program files / apache group g: / program files / apache group / apache group / tomcat 5.0.7) then copy mod_jk_2.0.46.dll to g: / program Files / Apache Group / Apache2 / Modules under.
First modify G: / Program files / apache group / apache2 / conf / http.conf: Find "DirectoryIndex", add index.jsp to then after INDEX.html: DirectoryIndex index.html index.jsp index.html.var Find "Listen", modify the port number below this: #Listen 12.34.56.78:80Listen 80 plus the following: loadingModule JK_Module Modules / Mod_jk_2.0.46.dll JkWorkersFile "G: / Program Files / Apache Group / Tomcat 5.0.7 / conf / workers.properties "JkLogFile" G: / Program Files / Apache Group / Tomcat 5.0.7 / logs / mod_jk2.log "JkLogLevel info
New Workers.Properties under G: / Program Files / Apache Group / Tomcat 5.0.7 / Conf.
Write the following: workers.tomcat_home = g: / program files / apache group / tomcat 5.0.7workers.java_home = g: /jbuilder9/jdk1.4 ps = / worker.list = ajp13 worker.ajp13.port = 8009 worker. Ajp13.host = localhost worker.ajp13.type = ajp13 worker.ajp13.lbFactor = 1
Save Workers.properties.
Finally, start Tomcat first, then start Apache, it is successful. Open http://127.0.0.1/ and http://127.0.0.1/ and http://127.0.0.1:8080/ can see the welcome screen of Tomcat. In G: / Program Files / Apache Group / Tomcat 5.0.7 / WebApps / Root, create a new demo.htm file, write Hello, World !!!, and save it. Open http://127.0.0.1/demo.htm and http://127.0.0.1:8080/demo.htm, you can see the newly built pages just now. But if you open http://127.0.0.1/jsp-examples/, 404 errors will appear, and http://127.0.0.1:8080/jsp-examples/ is normal. Next we need to add a mapping of the virtual directory in http.conf.
Find in http.conf: "Alias", continue to find "icons", find one below: Alias / ICONS / "G: / Program Files / Apache Group / Apache2 / icons /"
Add I need the virtual directory: Alias / JSP-Examples / "G: / Program Files / Apache Group / Tomcat 5.0.7 / WebApps / Servlets-Examples"
I finally understood that I have never been successful before, one for the previous reason is: http.conf "g: / program files / apache group / tomcat 5.0.7 / webapps / root" like a space-containing path There is no quotation, causing Apache to be parsed correctly, so it has been wrong: (, most of them are installed in C: / Apache, C: / Tomcat5 path, so do not encounter such errors .