Integrate JDK1.4.1 + Apache2.0.44 + Tomcat4.1.18 under Windows2000 Platform

xiaoxiao2021-03-06  41

Integrate JDK1.4.1 Apache2.0.44 Tomcat4.1.18 under Windows2000 Platform

Software Environment:

Windows 2000 PROFESSIONAL SP3

2. JDK 1.4.1_02 (

http://java.sun.com)

3. Apache 2.0.44 (

http://www.apache.org)

4. Tomcat 4.1.18 (

http://jakarta.apache.org)

Install JDK

Install the JDK in the D: / MyWebApps / JDK 1.4.1_02 directory.

Establish a JavaCode folder in the D partition, and the Java source file you have written later will be placed in the D: / javacode directory.

Install Apache

The installation process is relatively simple, and it can be installed as prompted.

Install Apache in the D: / MyWebApps / Apache 2.0.44 directory.

Install Tomcat

It is recommended to download Tomcat's ZIP compressed file. Download directly to decompress it.

Put Tomcat in the D: /MYWebApps/tomcat-4.1.18 directory.

Configure environment variables

1. Java_Home D: / MyWebApps / JDK 1.4.1_02

2. Classpath.; D: / javacode

3. Catalina_Home D: /mywebapps/tomcat-4.1.18

4. Path% java_home% / bin;% catalina_home% / bin

5. Add the path to the D: /MYWebApps/tomcat-4.1.18/common/lib/servlet.jar to the ClassPath variable, or copy the file to D: / myWebApps / JDK 1.4.1_02 / jre / lib / EXT directory.

Configure Tomcat

1.

Create a new XMJ folder in the D: /MYWebApps/tomcat-4.1.18/webapps directory.

The JSP file written in it later

D: /mywebapps/tomcat-4.1.18/webapps/xmj directory.

Servlet / javabean file is put

D: /mywebapps/tomcat-4.1.18/webapps/xmj/web-inf/classes directory.

2.

Add the following code in the D: /MYWebApps/tomcat-4.1.18/conf/server.xml file:

Reloadable = "true" crossText = "true">

3.

Add the following code in the D: /MYWebApps/tomcat-4.1.18/conf/web.xml file:

Invoker

1

/ servlet / *

Configuring Apache

1.

New D: / MyWebApps / Apache 2.0.44 / apache2 / htdocs / xmj directory, after you write HTML, HTM files are placed in this folder.

2.

Download MOD_JK2-2.0.43.dll file, the address is as follows:

Http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/release/v2.0.1/bin/win32/mod_jk2-2.0.43.dll After downloading this file in d: / mywebapps / apache 2.0.44 / apache2 / modules directory.

3.

The last line of the D: / MyWebApps / Apache 2.0.44 / apache2 / conf / httpd.conf file adds the following code:

LoadModule JK2_Module Modules / MOD_JK2-2.0.43.DLL

4.

New D: / MyWebApps / Apache 2.0.44 / apache2 / conf / workers2.properties file.

The contents of this document are as follows:

# Define the communication channel

[Channel.socket: Localhost: 8009]

INFO = ajp13 forwarding over socket

Tomcatid = localhost: 8009

# Map the tomcat examples Webapp to the Web Server Uri Space

[URI: / example / *]

[URI: / XMJ / *]

INFO = Map the whole WebApp

5.

Edit D: / MyWebApps / Apache 2.0.44 / apache2 / conf / httpd.conf file.

Find the DocumentRoot items, change this line to:

DocumentRoot "D: / mywebapps / apache 2.0.44 / apache2 / htdocs / xmj"

Test JDK

Open an MS-DOS window, if java, javac commands are available normally, indicating that the JDK configuration is successful.

Test Tomcat

Start Tomcat.

Enter: in IE browser address bar:

Http: // localhost: 8080, if the welcome page appears, the configuration is successful.

Test Apache

Place an HTML file in the D: / MyWebApps / Apache 2.0.44 / apache2 / htdocs / xmj directory.

For example: Welcome.html

Close Tomcat, start Apache.

Enter: In IE address bar:

Http://localhost/welcome.html, if this page is displayed normally, the configuration is successful.

2

Test the integration of Apache and Tomcat

Place a JSP file in the D: /MYWebApps/tomcat-4.1.18/webapps/xmj directory.

For example: myjspfile.jsp

Place a servlet's class file in the D: /MYWebapps/tomcat-4.1.18/webapps/xmj/web-inf/classes directory.

For example: MyServlet.class

Start Tomcat first, then launch Apache.

Enter: IE address bar:

http://localhost/welcome.html

http://localhost/xmj/myjspfile.jsp

http:// localhost / xmj / servlet / myservlet

If these pages can be displayed normally, the integration is successful.

Author: Xu Mingjie

xmjdev@yahoo.com.cn

Part of this article comes from

Tomcat forum for www.chinajavaworld.com.

Install successfully on my machine, try it! I wish my brother succeed!

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

New Post(0)