beebe_3 发表于 2015-8-4 08:13:18

CentOS Apache+Tomcat 整合配置(两种办法)

整合篇 方法一
#wget http://archive.apache.org/dist/t ... s-1.2.30-src.tar.gz
#tar zxvf tomcat-*
#cd tomcat-*/native
#./configure --with-apxs=/usr/local/apache/bin/apxs
#make && make install
到apache的modules下面看看有没有mod_jk.so模块


配置apache支持jk模块
#vim /usr/local/apache/conf/httpd.conf
添加 index.jsp   
DirectoryIndex index.jsp index.html

LoadModule   jk_module    modules/mod_jk.so…

Include conf/extra/mod_jk.conf


#vim /usr/local/apache/conf/extra/mod_jk.conf
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] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
#Sample JkMounts.   Replace these with the paths you would
#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 /func/* worker1
JkMount   /assets/*          worker1
JkMount   /remote/*          worker1
JkMount   /services/*      worker1
JkMount   /homebase/*      worker1
JkMount /skin/*      worker1
JkMount /error/*   worker1
JkMount /lib/*       worker1
JkMount /protected/*       worker1
JkMount /rounded/*       worker1
JkMount /FormOverLogin*       worker1
JkMount /fckeditor/editor/filemanager/connectors/*       worker1
JkMount /upload/image/*       worker1


#vim /usr/local/apache/conf/extra/workers.properties
worker.list=worker1   
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.woker1.lbfactor=1


修改tomcat跟apache知道让web指向同一个目录
#vim /usr/src/tomcat/conf/server.xml
      
      



#/usr/local/apache/bin/apachectl restart
# /usr/local/tomcat/bin/shutdown.sh
#/usr/local/tomcat/bin/startup.sh


测试页面
#vim /usr/local/apache/htdocs/index.jsp
页: [1]
查看完整版本: CentOS Apache+Tomcat 整合配置(两种办法)