2013年3月15日 星期五

apache 整合 tomcat 的二種方式



tomcat-connectors

http://tomcat.apache.org/connectors-doc/

#wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz
#tar -zvxf tomcat-connectors-1.2.37-src.tar.gz
#cd tomcat-connectors-1.2.37-src/native
#./buildconf.sh
#./configure --with-apxs=/usr/sbin/apxs
#make
#make install
#vi workers.properties
#vi jk_mode.conf
#vi ssl.conf
#service httpd restart

jk_module








workers.properties
 

worker.list=worker1

worker.worker1.type=ajp13

worker.worker1.host=localhost

worker.worker1.port=8009

worker.worker1.connection_pool_timeout=600

worker.worker1.socket_keepalive=1

worker.worker1.socket_timeout=60

 

jk_mod.conf

 

LoadModule jk_module modules/mod_jk.so

JkWorkersFile conf/workers.properties

JkLogFile /tmp/mod_jk.log

JkMount /test1/*.jsp    worker1

JkMount /manager/*      worker1

 

ssl.conf

.......

JkMount /test1/*.jsp    worker1

JkMount /manager/*      worker1

</VirtualHost>  


Proxy_ajp
 

proxy_ajp.conf

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

 
#

# When loaded, the mod_proxy_ajp module adds support for

# proxying to an AJP/1.3 backend server (such as Tomcat).

# To proxy to an AJP backend, use the "ajp://" URI scheme;

# Tomcat is configured to listen on port 8009 for AJP requests

# by default.

 

# Uncomment the following lines to serve the ROOT webapp

# under the /tomcat/ location, and the jsp-examples webapp

# under the /examples/ location.

#

 
#ProxyPass /tomcat/ ajp://localhost:8009/

#ProxyPass /examples/ ajp://localhost:8009/jsp-examples/

 

ProxyPass /test1/ ajp://localhost:8009/test1/

ProxyPass /manager/ ajp://localhost:8009/manager/

沒有留言:

張貼留言