For apache+tomcat+jsp+php integration, there is a slight difference between the different versions of Tomcat and Apache.
First, the required software
(1) Jdk:jdk-7u15-windows-x64.exe
JDK version relationship is not very large, does not affect the integration of Apache and Tomcat, configure the environment variables to pay attention to some of the line.
(2) Apache:httpd-2.2.25-win32-x86-no_ssl.msi
The Apache version does not have much impact on consolidation, and it is important to note the version of the mod_jk.so file when integrating Tomcat when loading the module (modules). The version of Apche must be the same as the mod_jk-**.so version. The main thing is that different versions make configuration cumbersome and useless!
Official website: http://httpd.apache.org/Detailed: http://apache.fayea.com/apache-mirror/httpd/binaries/win32/
(3) Tomcate:apache-tomcat-8.0.3.exe
Official website: http://tomcat.apache.org/
(4) mod_jk.so
In detail: http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/
Note:the version of Apche must be the same as the mod_jk-**.so version. The main is the different version makes the configuration trouble, but also useless! My Apache is Httpd-2.2.25-win32-x86-no_ssl.msi required files such as:
Second, install the software
Installation process There's a lot of information on the Internet.
The directory I installed is as follows:
Third, configuration Run Apache
1, modify the httpd.conf
Find httpd.conf in E:\service\Apache2.2\conf use editor to open
(1). Modify the Default Web site root directory:
Create a folder www under the e-packing directory as the root directory of the Web site
DocumentRoot "D:/server/apache Group/apache2.2/htdocs"
Change to DocumentRoot "E:/www"
<directory "D:/server/apache Group/apache2.2/htdocs" >
Change to <directory "E:/www" >
(2). modifying character settings
Apache Parsing Chinese web page will produce garbled,
Modify Adddefaultcharset iso-8859-1 to Adddefaultcharset GB2312
(3). Modify the default home page
When the directory is accessed, Apache automatically imports the home page, whichever priority is in order
Change DirectoryIndex index.html Index.html.var to
DirectoryIndex index.html index.jsp index.php default.jsp default.php Index.html.var
(4). Set error page
This will be more secure for your site, if not set, others in your URL after entering a random path, will show 404 error
Your server version number and server configuration at a glance, in order to avoid this situation, you can set the error page.
When a 404 error occurs, which means that the page is not found, the visitor is imported to an error page
Found it:
#
# Customizable error responses come in three flavors:
# 1) Plain text 2) local redirects 3) external redirects
#
# Some Examples:
#ErrorDocument "The server made a boo boo."
#ErrorDocument 404/missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#
This part of the httpd.conf, #ErrorDocument 404/missing.html
A row is modified to ErrorDocument 404/error/nofile.htm, where nofile.htm is the next error file for D:\server\www\error\ and requires you to build it yourself. When a 404 error occurs, go to the nofile.htm page and you can be prompted that the page is not found. This makes it impossible to see your server software information. You can also set other error-oriented pages, specific HTTP response error number please refer to the relevant information.
Restart Apache, if no accident, at this time has been installed successfully, the static page into the D:\server\www\error\ directory, see if you can successfully parse. Just type in one: http://localhost/sdagasgdasasg.htm, see if it's the 404 error you set, i.e. the nofile.htm error page.
2. Support PHP
After # include conf/extra/httpd-vhosts.conf, add
#配置php
LoadModule php5_module "E:/service/php/php5apache2_2.dll"
AddType application/x-httpd-php. php3. php
AddType Application/x-httpd-php-source. Phps
AddType application/x-httpd-php. po. py. pl. hu
# Phpinidir
Phpinidir "e:/service/php"
#配置php END
Create a Web page under E:\WWW: index.php, with the following:
<?php
Phpinfo ();
?>
Edit with text editor to save as index.php, restart Apache, enter http://localhost/index.php in IE, if PHP
Environment variables, description PHP, installation successful, if cannot parse <?php phpinfo ();?> part, the installation is not successful.
Note:LoadModule php5_module "E:/service/php/php5apache2_2.dll" should correspond to PHP files.
Four. The integrated configuration of Tomcat and Apache
1, in the E:\service\Apache2.2\modules folder to add the above download good mod_jk.so
2. Add Mod_jk.log in the E:\service\Apache2.2\logs folder
3. Add the support Tomcat module to the E:\service\Apache2.2\conf\httpd.conf file
LoadModule jk_module "E:/service/apache2.2/modules/mod_jk.so"
#加载JK模块
Jkworkersfile "E:/service/tomcat 8.0/conf/workers.properties"
#指定先前配置的worker文件
Jklogfile "E:/service/apache2.2/logs/mod_jk.log"
Last additions to the file
<virtualhost *:80>
DocumentRoot e:/www
ServerName www.javen.com
DirectoryIndex index.php index.html Index.html.var
Jkmount/*web-inf ajp13
Jkmount/*.jsp ajp13
jkmount/servlet/* ajp13
Jkmount/*.do ajp13
Jkmount/*.action ajp13
jkmount/javenmy/* ajp13
</VirtualHost>
4. Add Workers.properties to the E:\service\Tomcat 8.0\conf folder
Workers.tomcat_home= "C:\Program files\apache software foundation\tomcat 8.0\" #让mod_ JK Module knows the installation path of Tomcat workers.java_home= "C:\Program files\java\jdk1.7.0_45\" #让mod_jk模块知道jdk路径ps =\ # The current directory worker.list=ajp13 #这里是关键, the name should be consistent with the httpd.conf. If you change httpd.conf here, you have to change it. worker.ajp13.port=8009 #工作端口, Tomcat's JK listener port, can be viewed in server.xml with port= "8009" Worker.ajp13.host=localhost # Tomcat machine, if installed in a different machine than Apache needs to set the Ipworker.ajp13.type=ajp13 #协议类型, can not be changed, there will be problems worker.ajp13.lbfactor=1 # Load Balancing Factor
all installation files and profiles:Http://pan.baidu.com/s/1kTDil6Z
Experience summary of server consolidation configuration under Windows apache+tomcat+jsp+php