标签:mod_jk安装
jk安装配置 jk用于整合apache与tomcat。 1、安装jk wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.40-src.tar.gz tar -xvf tomcat-connectors-1.2.40-src.tar.gz cd tomcat-connectors-1.2.40-src/native/ ./configure --with-apxs=/usr/local/apache/bin/apxs make ls ./apache-2.0/mod_jk.so cp ./apache-2.0/mod_jk.so /usr/local/apache/modules/ 2、apache配置jk cd /usr/local/apache/conf cat >> mod_jk.conf <<-‘EOF‘ # 指出mod_jk模块工作所需要的工作文件workers.properties的位置 JkWorkersFile /usr/local/apache/conf/workers.properties # Where to put jk logs JKLogFile /usr/local/apache/logs/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel info # Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" # JkOptions indicate to send SSL KEY SIZE, #JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # JkRequestLogFormat set the request format JkRequestLogFormat "%w %V %T" # 将所有servlet 和jsp请求通过ajp13的协议送给Tomcat,让Tomcat来处理 JkMount /servlet/* worker1 JkMount /*.jsp worker1 EOF cat >> workers.properties <<-‘EOF‘ #workers.properties 是转发模块的工作单,用来定义转发主机和监听端口等内容 worker.list=worker1 # Set properties for worker1 worker.worker1.type=ajp13 worker.worker1.host=localhost worker.worker1.port=8009 worker.worker1.lbfactor=50 #worker.worker1.cachesize=10 #worker.worker1.cache_timeout=600 #worker.worker1.socket_keepalive=1 #worker.worker1.socket_timeout=300 EOF cat >> httpd.conf<<-‘EOF‘ LoadModule jk_module modules/mod_jk.so Include conf/mod_jk.conf EOF sed -i s#\#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so# httpd.conf 修改tomcat的server.xml在HOST内添加。 <Context path="" docBase="/usr/local/apache/htdocs/" debug="0" reloadable="true" crossContext="true"/> 测试index.jsp <html> <body> <center>Now time is: <%=new java.util.Date()%></center> </body> </html>
标签:mod_jk安装
原文地址:http://zhulintingfeng.blog.51cto.com/1140234/1570368