Windows2000 integrated apache2 with tomcat4

xiaoxiao2021-03-06  43

Title: Integration under Windows2000 Apache2 and Tomcat4 Author: robornet Date: 2002-10-30 reason: to engage in a java project for some time, and that time distribution, and can not find a copy of the latest Apache2 integration and configuration of Tomcat4, then After reading the Jakarta online information for a long time, refer to the previous netizen's article, wrote this configuration document, for reference, welcome ax! Directory: First, Software Preparation II, Software Installation Three, First Configuration and Test 4

step:

First, software preparation: Suppose you have a hard software environment that can run Win2000. 1.j2sdk1.4.1: to http://java.sun.com/j2se/1.4.1/download.html download! (Note is the SDK version of Windows (All Languages, Including English) 2.Apache2.0.43: to http://www.apache.inetcosmos.org/dist/httpd/binaries/win32/apache_2.0.43-win32- x86- NO_ssl.msi download! 3.Tomcat 4.1.12: to http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.1/bin/jakarta-tomcat-4.1.12.exe download! 4.MOD_JK.DLL: to http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk/release/v1.2.0/bin/win32/mod_jk-2.0.42.dll download! (Instead, due to mod_jk2-2.0.43.dll and apache2.0.43 configuration is not successful, use mod_jk-2.0.42.dll replacement)

Second, the software installation: (1) Install J2SDK: 1. Install according to the installation wizard (generally installed under C: /J2SDK1.4.1, facilitate the following) (2) Install Apache: 1. Install according to the installation wizard (select Installation The directory is C: /, facilitating the following operation; after the installation is successful, its path is: c: / apache2) (3) Install Tomcat: 1. Follow the installation wizard (Change the installation directory to C: / Tomcat4, if it is just test, no It is necessary to install Tomcat as a Services, which is convenient for you to enter the password of Admin (System Administrator).

Third, the first configuration and test: the first time the software environment installed, and the environment is tested. (1) Configuration - Environment Variable: 1. New System Variable Java_Home, its value is: c: /j2sdk1.4.1 // If you do not press the above path to install, change to the correct path 2. New system variable tomcat_home, its value To: c: / tomcat4 //, the new system variable ClassPath, its value is:% java_home% / lib;% Tomcat_home% / lib (2) Modify error: 1.Apache2.0.43 has a small problem, default installation success There is no index.html file in the HTDOCS directory under the home directory of Apache2, you must rename index.html.en in this directory to INDEX.HTML (3) Test default service: please run apache2 and tomcat4. 1. Open The browser enters: http: // localhost test: You can see the welcome interface of Apache2 at this time. Description Apache2 works fine. (Note that the Tomcat default port is 80, if there is other programs, Please change, hereby instructions below) 2. Open the browser and enter: http:// localhost: 8080 in the address bar: You can see Tomcat's welcome interface in your browser. Description Tomcat works fine. (Note, Tomcat default port is 8080, if there is any other program occupied, please change, the following is explained below: If there is no error in this step, then the following operations, let 'go! (4) Test your item: Now Test your project with Tomcat, for convenience, assuming that you have a project in the E: / Application / OA directory (including index.jsp and other JSP files and beans, such as WEB-INF / CLASSES / SERVLET Javabean. 1. Set Tomcat to support your project, open the c: /tomcat4/conf/server.xml file, add " before "" before "" DEBUG = "0" DOCBASE = "E: / Application / OA" RELOADABLE = "true" /> saved. Description: Context (Represents a web application): DOCBASE defines the path to the application; Path represents the prefix of the URL of this web application, so the requested URL is http: // localhost: 8080 / oa; reloadable this property is very important, If TRUE, Tomcat automatically detects changes in the application's / web-inf / lib and / web-inf / class directory, automatic loading of modifications or new beans and servlets, we can see if you don't worry about Tomcat Go to the BEAN to vary to the JSP.

2. Start your Tomcat 4.1.12, enter http: // localhost: 8080 / OA in the browser address, such as your JSP and Bean, servlets have no errors, usually make your index.jsp / index.html file The content is executed and displayed. Summary: If there is no error in this step, you can continue the following operations, let 'go! 4, integrated configuration: Do the corresponding configuration for Apache and Tomcat, let it work together. If Apache2 is running with Tomcat4, close them. (1) Configure Apache2: 1. Copy the downloaded mod_jk-2.0.42.dll to C: / Apache2 / Modules. 2. Set the home page file type: Open httpd.conf under C: / Apache2 / Conf, find "DirectoryIndex", add index.jsp after index.html, save, pay attention to each other. 3. Set the virtual host, let Apache automatically control the resolution of HTML and JSP: Open C: /Apache2/conf/Httpd.conf, add the following segment and save. // localhost is this machine, you can use this machine ip serveradmin robornet@robornet.com // Your Mail address DocumenTroot E: / Application // The root directory of your project group, because there is OA under Application OA and more A project, so you can only set it to the E: / Application ServerName Localhost // Your service name, if your machine has domain name, set it to domain name, but the software is used to test ErrorLog logs / robornet_home_log.txt // error log, Under C: / Apache2 / logs, you can use any other name CustomLog logs / robornet_custom_log.txt common // Under C: / Apache2 / logs, you can use any other name 4. Set between Apache and Tomcat. Connection, let Apache encountered the JSP file, put it in the background to Tomcat: Open C: /Apache2/conf/httpd.conf, and add the following segment and save it.

# Using mod_jk2.dll to redirect Dynamic Calls to Tomcat loadModule JK_Module Modules / MOD_JK-2.0.42.dll // Load Module for handling connection JKWorkersFile "c: /tomcat4/conf/Workers.properties" // setting module work Document, the following will explain the log files for the JKLogFile "C: /TOMCAT4/LOGS/MOD_JK2.LOG" //, and the TOCMAT starts to build JKMOUNT / servlet / * ajp13 // allows Apache to transfer servlet, used to Tomcat analysis jkmount /*.jsp Ajp13 // allows Apache support to transfer to JSP, to Tomcat resolution Summary: This apache is basically completed, but at this time Apache is not working properly.

(2) Configure Tomcat4: 1. Newly built a file in C: / Tomcat4 / Conf, new file workers.properties pay attention to file suffixations, it is recommended to use EditPlus or UltraEdit, if you use notepad, remember to change your name, don't become workers.properties.txt The content is as follows: workers.tomcat_home = c: / tomcat4 // Let the MOD_JK module know Tomcat workers.java_home = c: /j2sdk1.4.1 // Let the mod_jk module know the J2SDK PS = / Worker.List = ajp13 // module version, There is an existing AJP14, do not modify the worker.ajp13.port = 8009 // work port, if you don't take it, you don't have to modify the worker.ajp13.host = localhost //, if the above Apache host is not localhost, modify Worker accordingly .ajp13.type = ajp13 // Type worker.ajp13.lbFactor = 1 // Agent number, no modification 2. Open the server.xml file under C: / Tomcat4 / confed: Find " ", the previous code: <-! Define an AJP 1.3 Connector on Port 8009 -> "org.apache.ajp.tomcat4.ajp13connector" port = "8009" minprocessors = "5" maxprocessors = "75" acceptcount = "10" debug = "0" / > -> Change to: <

! - Define a coyote / jk2 ajp 1.3 Connector on Port 8009 -> org.apache.coyote.tomcat4.coyoteconnector "port =" 8009 "MINPROCESSORS =" 5 "MaxProcessors =" 75 "enableLookups =" true "redirectPort =" 8443 "acceptCount =" 10 "debug =" 0 "connectionTimeout =" 20000 "useURIValidationHack =" false "protocolHandlerClassName =" org.apache.jk.server.JkCoyoteHandler "/> -> < ! - Define an AJP 1.3 Connector on Port 8009 -> After saving. Small knot: Brothers must be tired! Ok, you can come to a cup of java, enjoy your results! Five, full line test: 1. Start apache2, tomcat4. 2. Open your browser and enter http: // localhost: 8080 / oa in the address bar. If the Tomcat is normal! 3. Enter http: // localhost / oa in the address bar. If the result is the same as http: // localhost: 8080 / oa, congratulations, Apache2 is successful with Tomcat4! ! !

Six, shortcomings: 1. Although the latest APAC

转载请注明原文地址:https://www.9cbs.com/read-62253.html

New Post(0)