WIN2000 + PHP + MYSQL + TOMCAT + JSP full integration installation manual

Source: Internet
Author: User
Tags define definition file info mysql php and version variable apache tomcat
Js|mysql 1. An installed WIN2000 server, note: If IIS is pre-installed, please deactivate or disable the IIS service first.

2. Next software

APACHE: Version: 1.3.22--apache_1.3.22-win32-x86.msi

JDK: Version: 1.3--j2sdk1_3_0-win.exe

PHP: Version: 4.0.4--php4.0.4pl1-win32.zip

MYSQL: Version: 3.23.32--mysql-3.23.32-win.zip

TOMCAT: Version: 4.0.4--jakarta-tomcat-4.0.4.exe

MOD_JK: This is a plug-in that Jakarta has developed to make Apache support Tomcat more powerful than Apachejserv because Apachejserv

Can only be used on Apache, but not on other webserver, mod_jk and a lot of servers with a combination of.

Download Address: http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/win32/i386/

(If you can not find the corresponding software in the Web site provided, please find it in the major online software library, generally have!) or send an email to apollo@risesun-cn.com)



3. Prepare enough dry food and water to prepare for repeated installation and restart, but as long as you follow the instructions carefully, a success is not

Difficult!

4. Take a deep breath, don't think mm! Start the installation!



Second, the installation began

1. Apache Installation

The first step: Run Apache_1.3.22-win32-x86.msi, all the way to determine and accept on the line, the basic comparison of fools, in order to facilitate the period and in line with my

The custom I installed the default path is C:\, this is installed in the C disk under the Apache path, and the default domain is Root.dev.

Step Two: (I made a virtual host here, this step can not do, according to your own needs)

Edit c:\apache\conf\httpd.conf

Find #NameVirtualHost *

Modified to Namevirtualhost 192.168.0.16 #注意这个IP为你自己主机设的IP

Find ServerName Root.dev

Modified to #ServerName Root.dev

Add to

<virtualhost 192.168.0.16>

ServerAdmin root@localhost

ServerName Root.dev

DocumentRoot C:/apache/htdocs

ErrorLog C:/apache/logs/error_log

Transferlog C:/apache/logs/access_log

Scriptalias/cgi-bin C:/apache/cgi-bin

</VirtualHost>

Step three: Change the filename c:\apache\htdocs\index.html.en to c:\apache\htdocs\index.html

Fourth step: Reboot, Access Http://root.dev Browse normal, show Apache Welcome page



------------a small success! You can have a sip of water! ----------------------------





2. MySQL Installation

First step: Extract Mysql-3.23.32-win.zip to directory D:\MYSQL

Step Two: Enter D:\MYSQL run SETUP.EXE all the way to return, the default installation to C:\MYSQL



There should be no problem------------this step!-------------------------------





3. PHP Installation

First step: Extract Php4.0.4pl1-win32.zip to directory D:\PHP

Step two: Copy the D:\PHP under the C packing directory

Step three: Enter C:\PHP and start configuring PHP

Change file name php.ini-dist to PHP.ini

Simultaneously copy php.ini and Php4ts.dll to WIN2000 's system installation directory

System32 and System directory (important, don't forget)

Modify Apache configuration files again httpd.conf (forget it! in c:\apache\conf\httpd.conf)

Add to:

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

Fourth step: Reboot the System

Step Fifth: Test

Write test file info.php (copy to directory c:\apache\htdocs\)

File contents: (On line)

? Phpinfo ();?>

Visit: http://localhost/info.php or http://root.dev/info.php

If you see the PHP Welcome Test page, the installation is successful!

So far, your system has been able to run the PHP program!

You've already configured win2000+apache+php+mysql.



----------------success in sight! Eat some dry food, like 5 minutes mm, go to the toilet, or harass the brother next door---------

---If you can be sure of 2 things you can go down:

1. Your IQ is actually higher than the Chinese Football Association's pile of waste.

2. Really want to enter the world of JSP roaming





4. Installation of JDK

The first step: directly run J2sdk1_3_0-win.exe, all the way carriage return installs, I here the default installation path is d:\jdk1.3

Step Two: Configure environment variables

Click the right mouse button on my Computer-Properties-click the Advanced-click environment variable

Pop-up environment Variable dialog box, create the following variable name and value:

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

Variable Name: path

Variable Value: D:\jdk1.3\bin

Variable name: java_home

Variable Value: d:\jdk1.3

Variable name: CLASSPATH

Variable value:. \;d: \jdk1.3\lib\dt.jar;d:\jdk1.3\lib\tools.jar;

Step three: Restart the computer for the configured environment variable to take effect



5. Tomcat installation

The first step: directly run the installation Jakarta-tomcat-4.0.4.exe, my default installation path here is C:\Apache Tomcat 4.0

If you start Tomcat individually (go to the TOMCA directory to run Startup.bat start Tomcat or run start on the menu bar)

Tomcat, you can already run the JSP file, but we haven't integrated Apache and Tomcat together because

Although Tomcat has a built-in Apache HTTP service, he only shows a better execution efficiency for JSP programs

and performance, for static page processing speed is far inferior to Apache, so for a perfect web system, we will

Apache and Tomcat are integrated together!

(The following is the integration of their specific configuration steps, please note carefully, I did 1 days to finally finish!) )

Step two: Configure Apache first

Open c:\apache\conf\httpd.conf

Add the following statement:

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

LoadModule Jk_module Libexec/mod_jk.dll

Addmodule MOD_JK.C

Jkworkersfile "C:\Apache Tomcat 4.0\conf\worker.properties"

Jklogfile Logs/mod_jk.log

Jkloglevel Info

Jklogstampformat "[%a%b%d%h:%m:%s%Y]"

Jkmount/*.jsp ajp13

jkmount/servlet/* ajp13

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

Note: The basic meaning of the above statement is:

First to second: Specify the location and name of the Apache and Tomcat connection Plug-ins

The location of the working files required to MOD_JK work

The seventh to eighth sentence: send all the JSP and servlet requests through the APJ13 protocol to Tomcat and let Tomcat handle

Step three: Download the mod_jk.dllcopy to the installation of the Apache directory under the libexec can be

Fourth Step: Tomcat configuration

The first is to build a worker.properties under the C:\Apache tomcat4.0\conf directory.

The contents of the document are as follows:

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

# $Header:/home/cvs/jakarta-tomcat/src/etc/attic/workers.properties,v 1.3.2.2 2000/10/16 01:59:22 larryi EXP $

# $Revision: 1.3.2.2 $

# $Date: 2000/10/16 01:59:22 $

#

#

# workers.properties-

#

# This file provides JK derived plugins and the needed information to

# Connect to the different tomcat workers.

#

# As a general note, the characters $ (and) are used internally to define

# Macros. Do don't use them in your own configuration!!!

#

# Whenever you'll have a set of lines such as:

# X=value

# y=$ (x) something

#

# The final value for y would be valuesomething

#

# normaly all your'll need to modify is the the-the-the-the-the-this-the-the-

# Workers.tomcat_home, Workers.java_home and PS. Most of the configuration

# is derived from.

#

# When you are do updating workers.tomcat_home, Workers.java_home and PS

# You should have 3 workers configured:

#

#-An AJP12 worker, connects to localhost:8007

#-An AJP13 worker, connects to localhost:8009

#-A jni inprocess worker.

#-A Load balancer worker

#

# However By default the plugins'll only use the AJP12 worker. To have

# The plugins use of the other workers and you should modify the Worker.list property.

#

#



#

# Workers.tomcat_home should point to the location where you

# installed Tomcat. This is where you have your conf, WebApps and Lib

# directories.

#

Workers.tomcat_home=c:\apache Tomcat 4.0





#

# Workers.java_home should point to your Java installation. Normally

# You should have a bin and lib directories beneath it.

#

workers.java_home=d:\jdk1.3



#

# You should configure your environment slash ... ps= on NT and/on UNIX

# and maybe something different elsewhere.

#

Ps=\

# ps=/



#

#------ADVANCED MODE------------------------------------------------

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

#



#

#------DEFAULT Worket List------------------------------------------

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

#

#

# The workers that your plugins should create and work with

#

WORKER.LIST=AJP12, AJP13



#

#------DEFAULT ajp12 WORKER DEFINITION------------------------------

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

#



#

# Defining a worker named Ajp12 and of type AJP12

# This is the name and the type do not have to match.

#

worker.ajp12.port=8007

Worker.ajp12.host=localhost

Worker.ajp12.type=ajp12

#

# Specifies the load balance factor when used with

# A load balancing worker.

# Note:

#----> Lbfactor must be > 0

#----> Low lbfactor means less work do by the worker.

Worker.ajp12.lbfactor=1



#

#------DEFAULT ajp13 WORKER DEFINITION------------------------------

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

#



#

# Defining a worker named Ajp13 and of type ajp13

# This is the name and the type do not have to match.

#

worker.ajp13.port=8009

Worker.ajp13.host=localhost

Worker.ajp13.type=ajp13

#

# Specifies the load balance factor when used with

# A load balancing worker.

# Note:

#----> Lbfactor must be > 0

#----> Low lbfactor means less work do by the worker.

Worker.ajp13.lbfactor=1



#

# Specify the size of the open connection cache.

#worker. ajp13.cachesize



#

#------DEFAULT LOAD balancer WORKER DEFINITION----------------------

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

#



#

# The LoadBalancer (type lb) workers perform wighted Round-robin

# load balancing with sticky sessions.

# Note:

#----> If A worker dies, the load balancer'll check its state

# once in a while. Until then all work are redirected to peer

# workers.

Worker.loadbalancer.type=lb

WORKER.LOADBALANCER.BALANCED_WORKERS=AJP12, AJP13





#

#------DEFAULT JNI WORKER DEFINITION---------------------------------

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

#



#

# Defining a worker named InProcess and of type JNI

# This is the name and the type do not have to match.

#

Worker.inprocess.type=jni



#

#------CLASSPATH DEFINITION-----------------------------------------

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

#



#

# Additional class path components.

#

worker.inprocess.class_path=$ (workers.tomcat_home) $ (PS) classes



#

# The XML parser provided with Tomcat

#

worker.inprocess.class_path=$ (workers.tomcat_home) $ (PS) lib$ (PS) Jaxp.jar

worker.inprocess.class_path=$ (workers.tomcat_home) $ (PS) lib$ (PS) Parser.jar



#

# Tomcat ' s implementation

#

worker.inprocess.class_path=$ (workers.tomcat_home) $ (PS) common$ (PS) lib$ (PS) Jasper.jar

worker.inprocess.class_path=$ (workers.tomcat_home) $ (PS) common$ (PS) lib$ (PS) Servlet.jar

worker.inprocess.class_path=$ (workers.tomcat_home) $ (PS) common$ (PS) lib$ (PS) Webserver.jar



#

# Javac as available from Java2se

#

worker.inprocess.class_path=$ (workers.java_home) $ (PS) lib$ (PS) Tools.jar



#

# Setting the command line for Tomcat

# note:the Cmd_line string may not contain spaces.

#

Worker.inprocess.cmd_line=-config

worker.inprocess.cmd_line=$ (workers.tomcat_home)/conf/jni_server.xml

Worker.inprocess.cmd_line=-home

worker.inprocess.cmd_line=$ (Workers.tomcat_home)



#

# The JVM that we are

#

# This is for JAVA2

#

worker.inprocess.jvm_lib=$ (workers.java_home) $ (PS) jre$ (PS) bin$ (PS) classic$ (PS) jvm.dll



#

# and this are for jdk1.1.x

#

#worker. inprocess.jvm_lib=$ (workers.java_home) $ (PS) bin$ (PS) javai.dll

#



#

# Setting the place for the stdout and stderr of Tomcat

#

worker.inprocess.stdout=$ (workers.tomcat_home) $ (PS) inprocess.stdout

worker.inprocess.stderr=$ (workers.tomcat_home) $ (PS) Inprocess.stderr



#

# Setting The Tomcat.home Java property

#

worker.inprocess.sysprops=tomcat.home=$ (Workers.tomcat_home)



#

# Java System Properties

#

# Worker.inprocess.sysprops=java.compiler=none

# Worker.inprocess.sysprops=myprop=mypropvalue



#

# Additional Path components.

#

# worker.inprocess.ld_path=d:$ (PS) sqllib$ (PS) bin

#



#--------------------------------------configuration file is complete-------------------------------------



In this document you need to be aware that there are only two places to modify, one is Workers.tomcat_home,

This is the directory that specifies Tomcat work, and the other is Workers.java_home, which is the target of the specified JDK

Record, we can make appropriate changes! My configuration here is not modified, are consistent with the configuration of my installation system!



Second, configure the Tomcat core file and open C:\Apache Tomcat4.0\conf\server.xml

Modified as follows:

Add <!--Define an AJP 1.3 Connector on port 8009-->

<!--

<connector classname= "Org.apache.ajp.tomcat4.Ajp13Connector"

Port= "8009" minprocessors= "5" maxprocessors= "75"

Acceptcount= "Ten" debug= "0"/>

-->

<!----> remove, this sentence familiar with XML people know it is annotation, because the default Tomcat4

is not enabled Apj13 8009 of the port that is used by MOD_JK, modified as follows:

<connector classname= "Org.apache.ajp.tomcat4.Ajp13Connector"

Port= "8009" minprocessors= "5" maxprocessors= "75"

Acceptcount= "Ten" debug= "0"/>

Then save and now your Tomcat and Apache configuration is basically done.



Fifth step: All configuration basically completes, restarts the computer, starts the overall test!





Test: You first start Apache, and then enter http://localhost in the browser, if you can see

To the Apache Welcome page, so congratulations, the first step is successful. And then back to the TOMCA directory.

Run Startup.bat start Tomcat, and then open the browser input: http://localhost:8080/

If you see cute tomcat, then congratulations, Tomcat is not a problem, and finally the most important thing is

The JSP and servlet can be interpreted under Apache, and the following code copy to the text editor is named

Hello.jsp,

The contents are as follows:

<%@ page contenttype= "text/html;charset=gb2312"%>


<body>

<%string str= "Hello world!"; %>

<%str=str+ "Hello";%>

<%=str%>

</body>


Save it to the C:\Apache Tomcat 4.0\webapps\root and enter it in the browser

http://localhost/hello.jsp If you see Hello, you did succeed.

------------------you're done, you can hum a ditty--------------------------

My this configuration document is tested, can really pass and run normally, hope can give you some help, if in

Please let me know if there is any problem in the course of the line.

My qq:5359496.

Email:apollo@risesun-cn.com

Secondly, I will elaborate on two questions:

1. Since I use a virtual host in configuring Apache, the Access address can be:

Http://localhost and Http://root.dev, but if you want to http://root.dev a successful visit, please

In the browser, make the following settings:

Internet Options-Connection-LAN settings

Select "Use Proxy Server", Address: 192.168.0.16 (write your host IP) port: 80



2. The JSP files that are accessed under the Apache host do not physically exist on the Apache host, but exist in the

Tomcat's host directory, for example:

The hello.jsp file in http://localhost/hello.jsp is not actually under c:\apache\htdocs\, but in

C:\Apache Tomcat 4.0\webapps\root under. Please note that this is not confusing concept!
!!!!!!!! Also be sure to download the same version as this article, otherwise it is easy to make mistakes. REMEMBER!!!!!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.