Integrated Tomcat5.5 + Apache under Win2003

xiaoxiao2021-03-06  19

After tossing for a long time, I finally integrated Tomcat5.5 Apache_ under Win2003.

2.0.53

MOD_JK_2.0.47.DLL

The project has started more than 2 weeks, and I thought Tomcat Apache was too trouble. I have been using Tomcat to do test (it is also enough), I will return to the meeting in the morning, come back N depressed, I have no mood to write code, try The marriage of Tomcat and Apache, which made a very stupid mistake, people are crazy, at 7:15 in the evening, finally got. Close-up one release is a commemoration.

Unsomantly works: wuchang @ gliet.edu.cn, QQ: 3263262, 2005.2.25 Yu Guilin Electronic Industry College

First, the first step is to download the software you need, this is not much

a) J2SDK has everywhere

b) apache at http://jakarta.apache.org /

c) Tomcat, MOD_JK2_

2.0.48

.dll (using mod_jk2.so) These two come here (http://archive.apache.org/dist/), what version is available, find your right, you can

Second, how to install these guys, don't say it, but pay attention to a Tomcat 5.5 essentible people JDK1.5 can run! The port is using the default, unless your system is still installed IIS, if you give apache Change a port, or stop IIS first (俺 is so dry, no need for IIS for this time).

Third, set a few environment variables

a) ClassPath =.;% java_home% / lib

b) java_home = c: / java / jdk

1.5.0

_01

c) Tomcat_home = d: /tomcat5.5

Fourth, start Tomcat and Apache service, test.

a) Enter http: // localhost / and http: // localhost / and http: // localhost: 8080 / If you can see the welcome interface of Apache and Tomcat, it is half a year. If you can't see it, please ask.

b) I don't like to enter localhost, I like to enter www.wuchang.com to access the machine. Are you like this? Of course, I can't do it, I have to change the Host file. This file of Win2003 system is in this directory C: / Windows / System32 / Drivers / etc, with Notepad, plus one line: 127.0.0.1 www.wuchang.com, save exit. Haha, enter www.wuchang.com in IE, you can also see the welcome picture of Apache. Of course, as long as you like it, you can add a www.ladeng.com.

V. Integration. After saying a bunch of nonsense, I finally said.

a) Put MOD_JK_

2.0.47

.dll or mod_jk2.so copies into the Apache2 / Modules directory, the name of the DLL is too long, I will help him change a name MOD_JK2.DLL, this world is quiet ...

b) Open the file apache2 / conf / httpd.conf, in the file, add a loadModule jk_module modules / mod_jk2.dll, pay attention to this, I am being hurt by this sentence :(

Httpd.conf is the most confmered profile in Apache. If you have a virtual directory, you will change here. For example, if you want to change the Apache's default home page, you can remove the last # of this file, and change the parameters such as DocuMENTROOT to you. Or the documentroot in the query file, change the value to your own web directory OK. c) Newly build a file workers2.properties under the apache2 / conf directory, add the following

#************************************************************ *****

[Logger.Apache2]

File = d: /apache2/logs/jk2.log

Level = INFO

Debug = 1

[config]

FILE = D: /Apache2/logs/Workers2.properties

Level = INFO

Debug = 1

[Channel.socket: Localhost: 8009]

Host = 127.0.0.1

Port = 8009

[SHM]

FILE = D: /Apache2/logs/jk2.shm

SIZE = 1048576

# Define the worker

[AJP13: Localhost: 8009]

Channel = Channel. Socket: 127.0.0.1: 8009

# [uri: / *] ### Indicates all requests under the main directory of the web to Tomcat.

[URI: / *. jsp] ## indicates all .jsp files to Tomcat processing

[URI: / *. DO]

[URI: / servlet / *]

[URI: / JSP-EXAMPLES / *] ## indicates all requests for all JSP-Examples directories to Tomcat processing, if you enter http://127.0.0.4/ jsp-example in the IE address bar, then you look The arrival will be http://127.0.0.1:8080/ jsp-example in content.

[URI: / servlets-example / *]

Of course, there are a lot of this file, if you download Jakarta-Tomcat-Connectors-JK

2.0.4

-win32-apache2.0.49.zip compressed package, with a detailed configuration instruction in the DOC directory, and has two workers2.properties.sample and mod_jk2.conf.sample to give you a reference.

d) Open the file Tomcat5.5 / conf / jk2.properties, modified as follows

Handler.list = Apr, Request, Channeljni

# Override The Default Port for the SocketChannel

Channelsocket.port = 809

#

# Shm.file = $ {jkhome} /work/jk2.shm

Apr.jnimodeso = D: /Apache2/modules/mod_jk2.so

# apr.jnimodeso = inprocess

Shm.file = d: /apache2/logs/jk2.shm

6. Start the Tomcat server and start the APACHE server. Tap! Write a JSP file to test it. If you can't do it.

Summarize the stupid things in this afternoon. Is there a lot of statements that already have a lot of LoadModule in httpd.conf? When I add a statement that adds the JK2 module, I want to save some things, I will change the original copy, and change the file name of the module to mod_jk2. . I didn't expect to change the name of the module, it became this look loadModule userDir_module modules / mod_jk2.so found that it was found to find out where, I thought it was my system problem, re-configured once. , Or make this fault (shaped face).

Later, I thought of the wrong log, in Apache2 / log / error.log, found in this log [Fri Feb 25 19:09:30 2005] [WARN] Module UserDir_Module IS Already loaded, skipping. Suddenly awake, hurry to see httpd.conf, the insects are sure enough, change to loadmodule jk2_module modules / mod_jk2.so, restart Apache service, get it.

Eat, you are so hungry.

Unsomantly works: wuchang @ gliet.edu.cn, QQ: 3263262, 2005.2.25 Yu Guilin Electronic Industry College

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

New Post(0)