alonli 发表于 2017-1-4 08:45:15

apache与tomcat集成准备工作

  网上有一大把的如何集成apache和tomcat的方法,但根本没有说明从何处得知mod_jk就是集成时需要的模块,查了tomcat文档,才从根本上解决了这个问题,下面是本人自己摸索的集成前的准备工作:
  1、tomcat中Connector有两种配置:http connector支持HTTP/1.1协议,使catalina作为独立部署的web服务器,也就是我们最常用的;ajp connector使用ajp协议与另外一个web连接器通信,它的主要用途就是可以使apache处理web应用的静态内容,利用apache的ssl处理能力。
  以下内容摘自tomcat文档(http://localhost:8080/docs/config/ajp.html)
  The AJP Connector element represents a Connector component that communicates with a web connector via the AJP protocol. This is used for cases where you wish to invisibly integrate Tomcat 6 into an existing (or new) Apache installation, and you want Apache to handle the static content contained in the web application, and/or utilize Apache's SSL processing.
  The native connectors supported with this Tomcat release are:
  1):JK 1.2.x with any of the supported servers
  2):mod_proxy on Apache httpd 2.x (included by default in Apache HTTP Server 2.2), with AJP enabled: see the httpd docs for details.
  2、根据英文提示,发现有一个叫做jk的东东,然后回到Docs Home(http://localhost:8090/docs/index.html),发现有一个参考中有jk 1.2版本的文档链接,点击后进入apache tomcat connector文档主页面,发现有下载jk的链接,下载后查看目录下有mod_jk.so文件,找到mod_jk文件
  3、返回apache tomcat connector文档主页面,点击Webserver HowTo下的Apache HTTP Server链接,这个页面详细介绍了如何配置mod_jk。在安装一节中,说明了mod_jk需要两个东东,mod_jk.xxx(刚刚下载的包里包含)和workers.properties,把英文摘录出来以便参考
  workers.properties - A file that describes the host(s) and port(s) used by the workers (Tomcat processes). A sample workers.properties can be found under the conf directory in the source download.
  这下清楚了,workers.properties范例在下载的src包的conf目录下。于是下载src包,发现src包原来不光包含src,还包含文档以及范例(这也太坑爹了)。
  好了,所有准备工作完成,可以参考文档来集成了。
页: [1]
查看完整版本: apache与tomcat集成准备工作