There are three different way to connect Tomcat and Apache:
1. JK is a project covering web-servers to Tomcat connectors, whereas mod_jk is the Apache module developed in JK.
IIS webserversupport is implemented on JK, using a redirector called isapi redirector.
Netscape/SunONE/Sun webserverwebserver support is implemented on JK, using a redirector called nsapi redirector.
2. http_proxy is a http proxy using HTTP protocol. It work both with Apache 1 and 2. It is very easy configure than JK, but lost some performance.
3. ajp_proxy comes with Apache 2.2.x, it's works with AJP protocol 1.3. So it gets the same performance as JK(even better) and the same easy configuration as http_proxy.
If you are using IIS, JK is the only solution. But if you are using Apache 2.2.x, ajp_proxy is the best solution. Now let's go with it. Since Tomcat 3.x, 4.x, 5.x and 6.x all support AJP 1.3, ajp_proxy can work well with them.
By default, ajp_proxy comes with Apache 2.2.x, to verify that, please check that there is a “proxy_ajp.conf” in “/etc/httpd/conf.d” folder (this is based on Redhat Linux, for some other linux system such as debain, “proxy_ajp.conf” is in “/etc/apache2/mods-available”).
And make sure there is such a line as below in “/etc/httpd/conf.d/proxy_ajp.conf”.
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
|
Now let's configure Tomcat as below example, adding a virtual host:
<Host name="hello-test.mycompany.com" debug="0"
appBase="/home/www/hello"
unpackWARs="false" autoDeploy="false">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="Hello." suffix=".log"
timestamp="true"/>
<Context path="" docBase="docs" debug="0" reloadable="true"/>
</Host>
|
Now add a virtual host configuration file for Apache, “/etc/httpd/conf.d/vhost_hello.conf” (Suggested that using vhost_ + AppName or Hostname):
<VirtualHost 192.168.1.6:80>
ServerAdmin aelbery@msn.com
ServerName hello-test.mycompany.com
ProxyPass / ajp://hello-test.mycompay.com:8009/
CustomLog /var/log/httpd/Hello.log combined
</VirtualHost>
|
Finally modify “/etc/hosts” or using DNS resolve the new virtual host: (Make sure both the server and clients can resolve correctly. )
192.168.1.6 hello-test.mycompany.com
|
分享到:
相关推荐
列表包含 mod_proxy.so mod_proxy_http.so mod_proxy_ajp.so mod_proxy_ftp.so mod_proxy_connect.so mod_proxy_balancer.so
apache安装,配置;tomcat下载,配置,设置为服务,有详解
apache服务器和tomcat服务器之间实现URL代理的module.so工具类文件
nginx_ajp_module-通过Nginx支持AJP协议代理 概要 http { upstream tomcats { server 127.0.0.1:8009; keepalive 10; } server { listen 80; location / { ajp_keep_conn on; ajp_pass tomcats; } } } ...
ajp_1129_酒店服务礼仪培训资料(ppt_29).pptx
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so 再找到<IfModule dir_module>加上index.jsp修改成 <IfModule dir_module> DirectoryIndex ...
apache2.2.4 负载均衡....LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_http_module modules/mod_proxy_http.so
NULL 博文链接:https://acooly.iteye.com/blog/1377732
apache服务器和tomcat的连接方法其实有三种:JK、http_proxy和ajp_proxy。本文主要介绍最为常见的JK。 环境:PC2台:pc1(IP 192.168.88.118)安装了apache和tomcat pc2(IP 192.168.88.168)安装了tomcat 系统 win ...
修改apache配置文件httpd.conf 启用mod_proxy_ajp 代码如下: #LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so 把这两行前面的#去掉即可 然后在末尾加上 ...
apache配置反向代理需要的so,配置参考如下: LoadModule proxy_module modules/mod_proxy.so...LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_connect_module modules/mod_proxy_connect.so
Tomcat性能调优方案,tomcat集群,tomcat配置 三、Apache集成Tomcat ... 如果一个项目中大量使用了静态页面、大量的图片...Apache和Tomcat的整合有三种方式,分别是JK、http_proxy和ajp_proxy.其中JK方式是最常见的方式
这是一个 Nginx 的模块,用来使用 Ajp 协议连接后端的 Tomcat ,相当于 Apache 上的 mod_jk 模块。 配置方法: upstream tomcats { server 127.0.0.1:8009 srun_id... ajp_pass tomcats; } } 标签:Nginx
首先,加载相应的代理模块,去掉以下模块前面的#号:LoadModule proxy_module modules/mod_proxy.soLoadModule proxy_ajp_module modules/mod_proxy_ajp.soLoadModule proxy_balancer_module modules/mod_proxy_...
White bells with pendulums of aniseHarmonies of glass where my lips become puppetsAnd take me to a gentle river of warm currentWhere I dream with seeing your gaze.But I refuse to open my eyes ...
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule proxy_...
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule mime_module modules/mod_mime.so LoadModule dav_module modules/mod_dav.so ...
nginx_ajp_module-0.3.0.zip 通过这个模块,Nginx可以直接连接AJP端口。 安装示例: $ wget 'http://nginx.org/download/nginx-1.4.4.tar.gz' $ tar -xzvf nginx-1.4.4.tar.gz $ cd nginx-1.4.4/ $ ./configure --...