At the end of this post, the background is edited by rootsecurity from 2012-2-2814: 12. as the JSP environment is required, I will write an article on Apache + Tomcat integration. Required software: 1、httpd-2.2.22.tar.gz2、tomcat-7.0.23.tar.gz 3, tomcat-connectors-1.2.30.t... This post was last edited by rootsecurity at PM
Background: As the JSP environment is required, I will write an article on Apache + Tomcat integration.
[Root @ localhost ~] #
6. check whether the modules directory under the apache installation directory contains mod_jk.so.
7. integrate Apache + Tomcat
There are two methods for integration: Reverse proxy and mod_jk. Since mod_jk is installed here, I will not talk about reverse proxy. at the end of the article, I will mention the reverse proxy method. Mod_jk is used for apache + tomcat integration.
Find the conf/extra directory under the apache installation directory (for convenience, put the configuration file in this directory)
Create a configuration file named mod_jk.conf and enter the following content. JkWorkersFile conf/extra/workers. properties
JkLogFile logs/mod_jk.log
JkShmFile logs/jk-runtime-status
JkLogLevel info
JkLogStampFormat "[% a % B % d % H: % M: % S % Y]"
# Sample JkMounts. Replace these with the paths you wowould
# Like to mount from your JSP server.
# Syntax: JkMount $ {URL_DIR}/*. jsp worker_name
JkMount/images/avatar/* worker1
JkMount/*. jsp worker1
JkMount/*. page worker1
JkMount/*. cic worker1
JkMount/*. do worker1
JkMount/*. action worker1
Save and create a new workers. properties File. enter the following content: worker. list = worker1
Worker. worker1.port = 8009
Worker. worker1.host = localhost
Worker. worker1.type = ajp13
Worker. woker1.lbfactor = 1
Finally, modify the DocumentRoot file of apache httpd. conf to be consistent with tomcat. Add index. jsp, index. do index. action to the DirectoryIndex option and restart apache.
Write a test page for index. jsp: <%
Out. println ("hello java ");
%>
Access verification successful
Here we will talk about the integration of reverse proxy for apache + tomcat. since it is a reverse proxy, tomcat-connectors does not need to be installed and the configuration file does not need to be changed, you only need to install apache, tomcat, and jdk. after you enable the respective services, modify httpd. conf. add the following statement at the end of the file:
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.