Win + Apache + Tomcat + PHP + mysq integration (original, Home)

Source: Internet
Author: User
Tags sapi
Used Software

Install php-4.3.4-win32.zip with GD library
C:/PHP
CP php4ts. DLL to C:/winnt/system32
Cp php. ini to C:/winnt

Install mysql-4.0.17-win.rar
C:/MySQL

Apache HTTP Server 2.0.46
Install it in D:/program files/Apache Group/apache2

J2sdk1.4.2 _ 05
Installed on D:/j2sdk1.4.2 _ 05

Tomcat 5.0
Installed on D:/tomcat 5.0

Mysql-connector-java-3.1.6
CP mysql-connector-3.0-bin.jar to D:/tomcat5/common/lib

Jakarta-tomcat-connectors-jk2.0.4-win32-apache2.0.49.zip (spare )!
Environment Variable
Classpath: D:/j2sdk1.4.2 _ 05/lib/DT. jar; D:/j2sdk1.4.2 _ 05/lib/tools. jar ;.; % java_home %/LIB; % java_home %/lib/DT. jar; % java_home %/lib/tools. jar; %
Java_home: D:/j2sdk1.4.2 _ 05
Path: % SystemRoot %/system32; % SystemRoot %/system32/WBEM; D:/j2sdk1.4.2 _ 05/bin
Tomcat_home: D:/tomcat 5.0

The default path is D:/JSP.
// Set httpd. COF
Add
Loadmodule php4_module C:/PHP/SAPI/php4apache2. dll // integrate PHP
Addtype application/X-httpd-PHP. php // integrate PHP
Loadmodule jk2_module modules/mod_jk2.so // integrate Apache and tomcat
If the path does not contain mod_jk2.so
Decompress jakarta-tomcat-connectors-jk2.0.4-win32-apache2.0.49.zip
Find in modules and copy it to the Apache directory modules
Modify
Adddefacharcharset gb2312
Add or modify
Namevirtualhost *

Servername www. customer1.it // modify as needed
Serveradmin sysmaster@arpa.veneto.it
DocumentRoot D:/PHP
Errorlog logs/cust1-errorlog

Jkuriset worker ajp13: localhost: 8009


Copy workers2.properties to apache2/Conf
It is best to directly use my configuration file to replace the file in Apache-conf with the file in apache2/CONF.

Modify tomcat configuration file
It is better to replace the files in Tomcat-conf with those in Tomcat 5.0/CONF.
After modification, copy jk2.properties and Catalina. properties to Tomcat 5.0/CONF.
Modified local server. xml

DEBUG = "0" reloadable = "true">
Set the directory JSP directory Driverclassname
Org. gjt. Mm. MySQL. Driver Set the MySQL driver URL
JDBC: mysql: // localhost: 3306/testdb? Autoreconnect = true Set ports, etc.
Restart the service.
Workers2.properties File Content
Logger. apache2]
Level = debug

[SHM]
File =/usr/local/Apache/logs/SHM. File
Size = 1048576

# Example socket channel, override port and host.
[Channel. Socket: localhost: 8009]
Port = 8009
Host = 127.0.0.1

# Define the worker
[Ajp13: localhost: 8009]
Channel = channel. Socket: localhost: 8009

# URI Mapping
[URI: 10.0.0.10/*. jsp]
Worker = ajp13: localhost: 8009

[URI: www.home.net/developer.jsp]
Worker = ajp13: localhost: 8009

[URI: www. customer1.it/*. jsp]
Worker = ajp13: localhost: 8009

[URI: www.mermer2.net/developer.jsp]
Worker = ajp13: localhost: 8009

Jk2.properties content
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:/program files/Apache Group/apache2/logs/jk2.shm

Catalina. properties File Content
Package. Access = sun., org. Apache. Catalina., org. Apache. Coyote., org. Apache. tomcat., org. Apache. Jasper., sun. Beans.
Package. Definition = sun., java., org. Apache. Catalina., org. Apache. Coyote., org. Apache. tomcat., org. Apache. Jasper.
Common. loader =$ {Catalina. home}/common/classes, $ {Catalina. home}/common/endorsed /*. jar, $ {Catalina. home}/common/lib /*. jar
Server. loader =$ {Catalina. Home}/Server/classes, $ {Catalina. Home}/Server/lib/*. Jar
Shared. loader =$ {Catalina. Base}/shared/classes, $ {Catalina. Base}/shared/lib/*. Jar

Preparation document
Serverroot "D:/program files/Apache Group/apache2"
Pidfile logs/httpd. PID
Timeout 300
Keepalive on
Maxkeepaliverequests 100
Keepalivetimeout 15

Threadsperchild 250
Maxrequestsperchild 0

Listen 80
Loadmodule access_module modules/mod_access.so
Loadmodule actions_module modules/mod_actions.so
Loadmodule alias_module modules/mod_alias.so
Loadmodule asis_module modules/mod_asis.so
Loadmodule auth_module modules/mod_auth.so
Loadmodule autoindex_module modules/mod_autoindex.so
Loadmodule cgi_module modules/mod_cgi.so
Loadmodule dir_module modules/mod_dir.so
Loadmodule env_module modules/mod_env.so
Loadmodule imap_module modules/mod_imap.so
Loadmodule include_module modules/mod_include.so
Loadmodule isapi_module modules/mod_isapi.so
Loadmodule log_config_module modules/mod_log_config.so
Loadmodule mime_module modules/mod_mime.so
Loadmodule negotiation_module modules/mod_negotiation.so
Loadmodule setenvif_module modules/mod_setenvif.so
Loadmodule userdir_module modules/mod_userdir.so
Loadmodule php4_module C:/PHP/SAPI/php4apache2. dll
Addtype application/X-httpd-PHP. php
Loadmodule jk2_module modules/mod_jk2.so

Serveradmin sanshi@tom.com
Servername 127.0.0.1: 80
UseCanonicalName off
DocumentRoot "D:/PHP /"

Options followsymlinks
AllowOverride none


Options indexes followsymlinks
AllowOverride none
Order allow, deny
Allow from all

Userdir "My Documents documents/my website"
Directoryindex index.html. var index. jsp
Accessfilename. htaccess

Order allow, deny
Deny from all

Typesconfig CONF/mime. Types
Defaulttype text/plain

Mimemagicfile CONF/magic

Hostnamelookups off
Errorlog logs/error. Log
Loglevel warn
Logformat "% H % L % u % t/" % R/"%> S % B/" % {Referer} I/"/" % {User-Agent} I/ ""
Combined
Logformat "% H % L % u % t/" % R/"%> S % B" common
Logformat "% {Referer} I-> % u" Referer
Logformat "% {User-Agent} I" Agent
Customlog logs/access. Log common
ServerTokens full
Serversignature on

Options indexes Multiviews
AllowOverride none
Order allow, deny
Allow from all

Alias/manual "D:/program files/Apache Group/apache2/manual"

Options indexes followsymlinks Multiviews IncludesNOEXEC
Addoutputfilter between des html
AllowOverride none
Order allow, deny
Allow from all

ScriptAlias/cgi-bin/"D:/program files/Apache Group/apache2/cgi-bin /"

AllowOverride none
Options none
Order allow, deny
Allow from all

Indexoptions fancyindexing versionsort
Addiconbyencoding (CMP,/icons/compressed.gif) x-compress X-Gzip

Addiconbytype (txt,/icons/text.gif) text /*
Addiconbytype (IMG,/icons/image2.gif) image /*
Addiconbytype (SND,/icons/sound2.gif) Audio /*
Addiconbytype (VID,/icons/movie.gif) Video /*

Addicon/icons/binary.gif. bin. exe
Addicon/icons/binhex.gif. hqx
Addicon/icons/tar.gif. Tar
Addicon/icons/world2.gif. WRL .wrl.gz. Fig. VRM. iv
Addicon/icons/compressed.gif. Z. Z. tgz. GZ. Zip
Addicon/icons/a.gif. PS. AI. EPS
Addicon/icons/layout.gif. html. shtml. htm. PDF
Addicon/icons/text.gif. txt
Addicon/icons/c.gif. c
Addicon/icons/p.gif. pl. py
Addicon/icons/f.gif.
Addicon/icons/dvi.gif. DVI
Addicon/icons/uuencoded.gif. uu
Addicon/icons/script.gif. conf. Sh. Shar. CSH. Ksh. TCL
Addicon/icons/tex.gif. Tex
Addicon/icons/bomb.gif Core

Addicon/icons/back.gif ..
Addicon/icons/hand.right.gif readme
Addicon/icons/folder.gif ^ directory ^
Addicon/icons/blank.gif ^ blankicon ^
Defaulticon/icons/unknown.gif
Readmename readme.html
Headername header.html
Indexignore .?? **~ * # Header * readme * rcs cvs *, V *, T
Addencoding X-compress Z
Addencoding X-gzip GZ tgz
Addlanguage da. dk
Addlanguage NL. nl
Addlanguage en. En
Addlanguage et. et
Addlanguage Fr. fr
Addlanguage de. de
Addlanguage he. He
Addlanguage El. El
Addlanguage it. it
Addlanguage Ja. Ja
Addlanguage pl. Po
Addlanguage KO. Ko
Addlanguage pt. PT
Addlanguage NN. nn
Addlanguage No. No
Addlanguage Pt-Br. Pt-Br
Addlanguage LTZ. LTZ
Addlanguage ca. ca
Addlanguage es. es
Addlanguage Sv. sv
Addlanguage CS. cz. CS
Addlanguage Ru. ru
Addlanguage ZH-TW. ZH-TW
Addlanguage HR. hr
Languagepriority en da NL et Fr de El it Ja ko no pl pt Pt-Br LTZ ca es SV TW
Forcelanguagepriority prefer fallback
Adddefacharcharset gb2312
Addcharset ISO-8859-1. iso8859-1. Latin1
Addcharset ISO-8859-2. iso8859-2. latin2. CEN
Addcharset ISO-8859-3. iso8859-3. latin3
Addcharset ISO-8859-4. iso8859-4. latin4
Addcharset ISO-8859-5. iso8859-5. latin5. Cyr. iso-Ru
Addcharset ISO-8859-6. iso8859-6. latin6. arb
Addcharset ISO-8859-7. iso8859-7. latin7. GRK
Addcharset ISO-8859-8. iso8859-8. latin8. heb
Addcharset ISO-8859-9. iso8859-9. latin9. TRK
Addcharset ISO-2022-JP. iso2022-jp. JIS
Addcharset ISO-2022-KR. iso2022-kr. kis
Addcharset ISO-2022-CN. iso2022-cn. CIS
Addcharset big5. big5. big5
# For Russian, more than one charset is used (depends on client, mostly ):
Addcharset windows-1251. cp-1251. Win-1251
Addcharset cp866. cp866
Addcharset KOI8-r. koi8-r. koi8-ru
Addcharset KOI8-ru. koi8-uk. ua
Addcharset ISO-10646-UCS-2. ucs2
Addcharset ISO-10646-UCS-4. ucs4
Addcharset UTF-8. utf8

# The set below does not map to a specific (ISO) standard
# But works on a fairly wide range of browsers. Note that
# Capitalization actually matters (it shocould not, But it
# Does for Some browsers ).
#
# See http://www.iana.org/assignments/character-sets
# For a list of sorts. But browsers support few.
#
Addcharset gb2312. gb2312. GB
Addcharset utf-7. utf7
Addcharset UTF-8. utf8
Addcharset big5. big5. B5
Addcharset EUC-TW. euc-TW
Addcharset EUC-JP. euc-JP
Addcharset EUC-KR. euc-KR
Addcharset shift_jis. sjis
Addtype application/X-tar. tgz
Addtype image/X-icon. ICO
Addhandler type-map VaR
Browsermatch "Mozilla/2" nokeepalive
Browsermatch "MSIE 4/. 0b2;" nokeepalive downgrade-1.0 force-response-1.0
Browsermatch "RealPlayer 4/. 0" force-response-1.0
Browsermatch "Java/1/. 0" force-response-1.0
Browsermatch & quot; JDK/1/. 0 & quot; force-response-1.0
Browsermatch "Microsoft Data Access Internet publishing provider" Redirect-carefully
Browsermatch "^ webdrive" Redirect-carefully
Browsermatch "^ webdavfs/1. [012]" Redirect-carefully
Browsermatch "^ gnome-VFS" Redirect-carefully

Include CONF/SSL. conf

Namevirtualhost *

Servername www.home.net
Serveralias WWW
Serveralias localhost
Serveradmin sysmaster@arpa.veneto.it
DocumentRoot D:/jsp

Errorlog logs/home.net-errorlog
Customlog logs/home.net-access. Log common

Jkuriset worker ajp13: localhost: 8009



Servername www. customer1.it
Serveradmin sysmaster@arpa.veneto.it
DocumentRoot D:/PHP
Errorlog logs/cust1-errorlog


Servername www.customer2.net
Serveradmin sysmaster@arpa.veneto.it
DocumentRoot D:/PHP
Errorlog logs/cust2-errorlog

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.