Apache2.0.43 + tomcat4.1.18 + mod

zhaozj2021-02-16  58

Apache2.0.43 tomcat4.1.18 mod_jk-2.0.43.dll integration

Author: Haley Date: 2003-02-20

First, software preparation: (operating system Windos 2000 Server)

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/ download!

3.Tomcat4.1.18: to http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.18/bin/jakarta-tomcat-4.1.18-le-jdk14.exe download!

4.MOD_JK.DLL: to http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk/release/v1.2.1/bin/win32/mod_jk-2.0.43.dll download!

Second, the software installation:

(1) Install J2SDK:

Install according to the installation wizard (generally installed under C: /J2SDK1.4.1, convenient below)

(2) Install Apache:

Follow the installation wizard (select the installation directory to C: /, convenient below; after the installation is successful, its path is: c: / apache2)

(3) Install Tomcat:

Follow the installation wizard (Change the installation directory to C: / Tomcat 4.1, convenient below), which will enter the password of Admin (System Administrator).

Third, the first configuration and test:

The software environment installed above is configured for the first time and tests its environment.

(1) Configuration - environment variable:

1. New system variable java_home, whose 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 is: c: / tomcat 4.1 //

3. New system variable ClassPath, its value is:% java_home% / lib;

(2) Modify the error:

Apache2.0.43 has a small problem. After the default installation is successful, there is no index.html file in the HTDOCS directory under the Apache2 home directory, you must rename index.html.en in this directory is index.html

(3) Test the default service:

Please run apache2 with tomcat 4.1.

1. Open the browser and enter: http: // localhost test: Http: // localhost test: You can see the welcome interface of Apache2 in the browser. Description Apache2 is working properly. (Note that the apache default port is 80, if there are other Program occupation, please change C: /Apache2/conf/httpd.conf.)

2. Open the browser and enter: http:// localhost: 8080 in the address bar: You can see Tomcat's welcome interface in the browser. Description Tomcat works fine. (Note that the Tomcat default port is

8080, if there is other programs, please change C: / Tomcat 4.1 / conf / server.xml. If there is no error in this step, then continue below, let 'go on!

(4) Test your project:

Now use Tomcat to test your project, for convenience of explanation, assuming that you already have a project in the E: / TEST directory, contain index.jsp and other files, pay attention to web-infault, usually Content

Public "- // Sun microsystems, Inc.//dtd Web Application 2.3 // en"

"http://java.sun.com/dtd/web-app_2_3.dtd">

1. Set Tomcat to support your project, open the C: / Tomcat 4.1 / conf / server.xml file, add "" before "" before ""

saved.

2. Start your Tomcat 4.1.18, enter http: // localhost: 8080 / test in your browser's address, such as your JSP and Bean, servlet, etc., usually you will use your index.jsp / index.html File

The content is executed and displayed.

If there is no error in this step, then continue below, let 'go on!

Fourth, integrated configuration:

Do the appropriate configuration for Apache and Tomcat to work together for you.

1. Copy the downloaded mod_jk-2.0.43.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 connection between Apache and Tomcat:

A, open C: /Apache2/conf/httpd.conf, add the following segment and save it.

LoadModule JK2_Module Modules / MOD_JK2-2.0.43.DLL

ServerAdmin Yourmail

DocumentRoot "E: / TEST"

ServerName Dummy-Host.example.com

DirectoryIndex index.htm index.html index.jsp

ErrorLog logs / dummy-host.example.com-error_log

Customlog logs / dummy-host.example.com-access_log Common

B. Create a file under C: / Apache2 / Conf: workers2.properties, the content is as follows:

[SHM]

File = $ {serverroot} /logs/shm.filesize=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

Ok, enjoy your results!

Five, full line test:

1. Restart the Apache2, Tomcat4.

2. Open your browser and enter http: // localhost: 8080 / test in the address bar. If the Tomcat is reconfigured, it is normal!

3. Enter http: // localhost / test in the address bar. If the result is the same as http: // localhost: 8080 / test, congratulations, Apache2 is successful with Tomcat4! ! !

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

New Post(0)