Win2000 + PHP + MYSQL + APACHE + TOMCAT + JSP is fully integrated

zhaozj2021-02-16  53

Win2000 PHP MYSQL APACHE TOMCAT JSP is fully integrated

-------------------------------------------------- -------------

Author: Chinese cabbage core January 27, 2004

-------------------------------------------------- -----------

I have sent 200 points in 9CBS and no one cares about me. Then I got it on Google for a long time, I found that it is basically a difficult problem when configuring Apache and Tomcat. I didn't sleep yesterday. I will get it now. I record this specific process, I hope to help everyone!

Preparation:

Installed Windows2000 Server, Close or Stop IIS

Download software:

Apache: 2.0.48 (Win32)

JDK: JSDK1.4.2

MySQL: mysql_4.0

PHP: 4.3.3

Tomcat: 5.0.18

MOD_JK.DLL AND MOD_JK2.DLL

The above two files need to be downloaded from http://jakarta.apache.org, if not please email: java@cu165.com I can send it to you :)

Start:

The first point:

There is nothing to say by Apache & mysql installation. It is basically NEXT to take the next way.

My Apache installation directory is E: / apache / apache2;

Note that the place is:

Apache 1.x version:

Add: httpd.conf Add:

LoadModule PHP4_MODULE C: /PHP/SAPI/php4apache.dll

AddType Application / X-httpd-php.php4

Scriptalias / PHP4 / "C: / PHP /"

Action Application / X-httpd-php4 "/ php4/php.exe"

AddType Application / X-httpd-php4.php

Apache 2.x version:

Add: httpd.conf Add:

LoadModule PHP4_MODULE C: /PHP/SAPI/php4apache2.dll

AddType Application / X-httpd-php.php

Find # adddefaultcharset ISO-8859-1. Then add it below

AdddefaultCharset GB2312

DEFAULTLANGUAGE GB2312

AddLanguage EN-CN .CN

This is set up Apache2 to Chinese support.

-------------------------------------------------- ------------

Two versions require a total settings:

DocumentRoot "i: / Webroot / JSPFile / Student" // Set the program file running

-------------------------------------------------- ------------

Second point:

PHP installation

Step 1: Unzip or install php4.3.3-win32.zip to directory D: / PHP

Step 2: Copy D: / PHP to the root directory of the C drive

Step 3: Enter C: / PHP and start configuring PHP

Change the file name php.ini-dist of PHP.INI

At the same time, copy PHP.INI and PHP4TS.DLL to the System32 and System Directory under the system installation directory of Win2000, it is recommended to copy all DLL files under the PHP under the PHP.

Step 4: Restart the system

Step 5: Test

Write test file info.php (copy to directory C: / apache / htdocs / below)

Document content: (on a line)

Visit: http://localhost/info.php

If you see the welcome test page of PHP, the installation is successful!

So far, your system can already run the PHP program!

You have configured Win2000 Apache PHP MySQL

JDK installation

Step 1: Directly run J2SDK1_4_2-win.exe, all the way to install, I hereby the default installation path is E: /J2SDK1.4.2

Step 2: Configure environment variables

Click the right click on my computer - click Advanced - Click on the environment variable

The Environment Variables dialog box pops up, newly created the following variable names and values:

-------------------------------------

Variable name: Path

Variable:.; E: /J2SDK1.4.2/bin; E: /J2SDK1.4.2

Variable name: java_home Variable: E: /J2SDK1.4.2

Variable name: ClassPath

variable:

E: /J2SDK1.4.2/lib/mm.mysql-2.0.4-bin.jar; E: /J2SDK1.4.2/lib/tools.jar; E: /J2SDK1.4.2/Lib/dt.jar; E : /J2SDK1.4.2/JRE/LIB/EXT

Step 3: Restart the computer to make the configured environment variable

Tomcat installation

Step 1: Directly run the installation jakarta-tomcat-5.exe, I am here the default installation path is c: / apache tomcat 5.0.18

At this time, if you start Tomcat separately (run Startup.bat in the Tomca directory, starting Tomcat or running on the menu bar.

Tomcat, you can already run the JSP file, but we have not integrated Apache and Tomcat yet because

Although Tomcat has built-in Apache HTTP service, he only refers to a better execution efficiency to the JSP program.

And performance, the processing speed of the static page is far less than Apache, so we have to be a perfect web system

Apache and Tomcat are integrated!

(Below is integrated with their specific configuration steps, please pay attention to carefully)

Step 2: Configure Apache first

Open E: /APACHE/apache2/conf/httpd.conf

Add the following statement:

1) Use this if using mod_jk.dll

# ------------------------------------------

# @ Uings_jk.dll to redirect Dynamic Calls to Tomcat

LoadModule JK_Module Modules / MOD_JK.DLL

JKWorkersfile "E: / Tomcat 5.0 / conf / workers.properties"

JKLogfile "E: / Tomcat 5.0 / logs / mod_jk.log"

JKMOUNT / Servlet / * ajp13

JKMount /*.jsp Ajp13

# ------------------------------------------------- ----

2) Use this sentence if you use MOD_JK2.DLL

# ------------------------------------------------- ----- loadModule JK2_Module Modules / MOD_JK2.DLL

# ------------------------------------------------- -----

Note: The basic meaning of the above statement is:

Third, five sentences: Specify the location and name of the Apache and Tomcat connection plugins

The sixth sentence: pointed out the position of the work file required for MOD_JK

Seventh, eight sentences: Yes to send all the JSP and Servlet requests to Tomcat through the APJ13 protocol, let Tomcat process

Step 3: Will the downloaded mod_jk.dll copy to Libexec under the Apache directory.

Step 4: Tomcat configuration

The first is to build a worker.properties in the E: / Tomcat 5.0 / Conf directory.

The document content is as follows:

Workers.tomcat_home = E: / Tomcat 5.0

Workers.java_home = E: /J2SDK1.4.2

PS = /

Worker.list = ajp13

Worker.ajp13.port = 8009

Worker.ajp13.host = localhost

Worker.ajp13.type = ajp13

Worker.ajp13.lbFactor = 1

It is necessary to pay attention to this file to modify only two places, one is workers.tomcat_home, which is the directory of the Tomcat work, and the other is worker.java_home, this is the specified JDK directory, you can make appropriate modifications! I have no modification here, all in line with the configuration of the system!

Second, configure Tomcat core files, open E: / Tomcat 5.0 / conf / server.xml

Specify your own virtual directory

And configure the server.xml configuration,

Enter it in the browser:

http: // localhost: 8080 / demo / test / index.jsp page shows normal.

Remarks:

E: /J2SDK1.4.2/lib's file recommendations are copied to E: / Tomcat 5.0 / Common / LIB

Now everything is basically OK. Of course, because the version of MOD_JK2.DLL may cause you if you are debugging. But the process on the upper side is basically no problem.

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

New Post(0)