WIN2000 + PHP + MYSQL + TOMCAT + JSP fully integrated installation manual _ MySQL

Source: Internet
Author: User
Tags file info
I. preparations 1. An installed WIN2000 server. note: if IIS is pre-installed, stop or disable the IIS service first. 2. Download software APACHE: version: 1.3.22-apache_1.3.22-win32-x86.msiJDK: version: 1.320.20.j2sdk1_3_0-win.exe PHP: version: 4.0.420.20.php4.0.4pl1-win32.zip MYSQL: version Tomcat manual mysql installation

I. preparations

1. An installed WIN2000 server. note: if IIS is pre-installed, stop or disable the IIS service first.

2. Downplant software

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

JDK: version: 1.3 20.20.j2sdk1_3_0-win.exe

PHP: version: 4.0.4 255.255.php4.0.4pl1-win32.zip

MYSQL: version: 3.23.32 20.20.mysql-3.23.32-win.zip

TOMCAT: version: 4.0.4 ――jakarta-tomcat-4.0.4.exe

Mod_jk: this is a plug-in developed by Jakarta to enable Apache to support Tomcat, which is more powerful than ApacheJserv because ApacheJserv

It can only be used on Apache, but not on other webservers. Mod_jk can be used together with many servers.

: Http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/win32/i386/

(If you cannot find the corresponding software on the provided Web site, please find it in various major online software libraries, generally! Or mail to apollo@risesun-cn.com)



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

Difficult!

4. Take a deep breath, don't think about MM! Start Installation!



II. start installation

1. Install APACHE

Step 1: run the apache_1.3.22-win32-x86.msi, all the way to confirm and accept on the line, basically more dummies, in order to facilitate the period and meet me

The default installation path is c: \. in this way, the APACHE path under drive c is installed, and the default domain is root. dev.

Step 2: (I have made a virtual host here. you can skip this step as needed)

Edit c: \ apache \ conf \ httpd. conf

Find # NameVirtualHost *

Change to NameVirtualHost 192.168.0.16 # note that this IP address is the IP address of your host.

Find ServerName root. dev

Change to # ServerName root. dev

Add



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



Step 3: change the file name c: \ apache \ htdocs \ index.html. en to c: \ apache \ htdocs \ index.html.

Step 4: Restart, access the http://root.dev to browse normally, display APACHE welcome page



------------ Small success! You can have a mouthful of water! ----------------------------





2. Install MYSQL

Step 1: extract the mysql-3.23.32-win.zip to directory D: \ MYSQL

Step 2: Enter D: \ MYSQL to run SETUP. EXE and press Enter. the default installation path is C: \ MYSQL.



------------ This step should be okay! -------------------------------





3. PHP installation

Step 1: extract the php4.0.4pl1-win32.zip to directory D: \ PHP

Step 2: Copy D: \ PHP to the C root directory

Step 3: Go to C: \ PHP and start configuring PHP

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

Copy php. ini and php4ts. dll to the WIN2000 installation directory.

In the system32 and system directories (important, don't forget)

Modify the APACHE configuration file httpd. conf again (forget it! In c: \ apache \ conf \ 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

Step 4: restart the system

Step 5: test

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

File content: (just one line)



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

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

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

You have configured win2000 + apache + php + mysql



---------------- Success! Eat some dry food, think 5 minutes MM, go to the toilet, or harass the next brother ---------

--- If you can confirm two things, you can proceed:

1. your IQ is indeed higher than the waste of the Chinese Football Association

2. I really want to enter the JSP world





4. JDK installation

Step 1: run the j2sdk1_3_0-win.exe directly and press enter to install it. the default installation path here is d: \ jdk1.3.

Step 2: Configure environment variables

Right-click my computer and choose Properties> Advanced> environment variable

In the displayed environment variable dialog box, create the following variable names and values:

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

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 3: restart the computer to make the configured environment variables take effect.



5. TOMCAT installation

Step 1: install jakarta-tomcat-4.0.4.exe directly. the default installation path here is c: \ Apache Tomcat 4.0.

In this case, if TOMCAT is started separately (run startup. bat in the directory named "CMDA" to start Tomcat or run start in the menu bar

Tomcat), you can run the JSP file, but we have not integrated APACHE and TOMCAT, because

Although TOMCAT has a built-in apache http service, it only shows better execution efficiency for JSP programs.

And performance, the processing speed for static pages is far less than APACHE, so for a perfect WEB system, we need

APACHE and TOMCAT are integrated!

(The following is the specific configuration steps for integrating them. please pay attention to them carefully. I have finished the configuration in just one day !)

Step 2: Configure APACHE

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 above statements basically mean:

Sentence 1: specify the location and name of the APACHE and TOMCAT connection plug-ins

Third sentence: point out the location of the work file required for mod_jk work

7. send all jsp and servlet requests to Tomcat through the Apj13 protocol for Tomcat to process

Step 3: Copy the downloaded mod_jk.dllcopy to libexec under the Apache installation directory.

Step 4: TOMCAT configuration

First, create a worker. properties in the c: \ Apache Tomcat4.0 \ conf directory.

The file content is 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 with the needed information

# Connect to the different tomcat workers.

#

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

# Macros. Do not use them in your own configuration !!!

#

# Whenever you see a set of lines such:

# X = value

# Y = $ (x) something

#

# The final value for y will be valuesomething

#

# Normaly all you will need to modify is the first properties, I. e.

# Workers. tomcat_home, workers. java_home and ps. Most of the configuration

# Is derived from these.

#

# When you are done updating workers. tomcat_home, workers. java_home and ps

# You shoshould have 3 workers configured:

#

#-An ajp12 worker that connects to localhost: 8007

#-An ajp13 worker that connects to localhost: 8009

#-A jni inprocess worker.

#-A load balancer worker

#

# However by default the plugins will only use the ajp12 worker. To have

# The plugins use other workers you shoshould modify the worker. list property.

#

#



#

# Workers. tomcat_home shocould 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 shocould point to your Java installation. Normally

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

#

Workers. java_home = d: \ jdk1.3



#

# You shoshould 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 shoshould create and work

#

Worker. list = ajp12, ajp13



#

# ------ DEFAULT ajp12 worker definition ------------------------------

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

#



#

# Defining a worker named ajp12 and of type ajp12

# Note that 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

# A load balancing worker.

# Note:

# ----> Lbfactor must be> 0

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

Worker. ajp12.lbfactor = 1



#

# ------ DEFAULT ajp13 worker definition ------------------------------

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

#



#

# Defining a worker named ajp13 and of type ajp13

# Note that 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

# A load balancing worker.

# Note:

# ----> Lbfactor must be> 0

# ----> Low lbfactor means less work done 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 wightted round-robin

# Load balancing with sticky sessions.

# Note:

# ----> If a worker dies, the load balancer will check its state

# Once in a while. Until then all work is 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

# Note that 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 parameter _line string may not contain in spaces.

#

Worker. inprocess. worker _line =-config

Worker. inprocess. worker _line = $ (workers. worker at_home)/conf/jni_server.xml

Worker. inprocess. worker _line =-home

Worker. inprocess. worker _line = $ (workers. worker at_home)



#

# The JVM that we are about to use

#

# This is for Java2

#

Worker. inprocess. jvm_lib = $ (workers. java_home) $ (ps) jre $ (ps) bin $ (ps) classic $ (ps) jvm. dll



#

# And this is 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

#



# -------------------------------------- The configuration file has been completed -------------------------------------



Note that there are only two changes to this file: workers. atat_home,

This is the directory where Tomcat works, and workers. java_home is the directory where Jdk is specified.

You can modify it as needed! I have not modified the configuration here, it is consistent with the configuration of my installation system!



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

Modify as follows:

Set



Of Removed. anyone familiar with XML knows that it is a comment, because the default Tomcat4

Is the port that has not enabled Port 8009 of Apj13, that is, mod_jk is used. the modification is as follows:


Port = "8009" minProcessors = "5" maxProcessors = "75"

AcceptCount = "10" debug = "0"/>

Save the configuration. now you have completed the configuration of Tomcat and Apache.



Step 5: complete all configurations, restart the computer, and start the overall test!





Test: start Apache and enter http: // localhost in the browser.

On the welcome page of Apache, congratulations! the first step is successful. Then go back to the directory named "CMDA ".

Run startup. bat to start Tomcat, and then open the browser and enter: http: // localhost: 8080/

If you see the cute Tomcat, congratulations, there is no problem with Tomcat, and the most important thing is

In Apache, jsp and Servlet can be interpreted. copy the following code to the text editor and name it

Hello. jsp,

The content is as follows:

<% @ Page contentType = "text/html; charset = gb2312" %>





<% String str = "Hello World! "; %>

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

<% = Str %>





Save it to C: \ Apache Tomcat 4.0 \ webapps \ ROOT, and enter

Http: // localhost/hello. jsp if you see Hello, you have succeeded.

------------------ You have achieved this point. you can just give it a try --------------------------

My configuration document is tested and can pass and run normally. I hope it will help you.

Please let me know if you have any problems during the process!

MyQQ: 5359496

EMAIL: apollo@risesun-cn.com

I will discuss two more questions:

1. Because I have used a virtual host in APACHE configuration, the access address can be:

Http: // localhost and http://root.dev, but if you want the http://root.dev to be accessed successfully

Make the following settings in the browser:

INTERNET option-connection-LAN settings

Select "use proxy server", address: 192.168.0.16 (write your host IP address) Port: 80



2. The JSP files accessed under the APACHE host do not physically exist on the host with APACHE, but exist on

TOMCAT host Directory, for example:

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

C: \ Apache Tomcat 4.0 \ webapps \ ROOT. Please note that do not confuse concepts!

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.