1、準(zhǔn)備,下載需要的文件。這里假定你已經(jīng)正確安裝配置好了JDK。 httpd-2.2.0.tar.gz 其中httpd和jakarta-tomcat-connectors為源碼包,apache-tomcat為二進制包。
# cd httpd-2.2.0 # ./configure --prefix=/usr/local/apache2 --enable-so # make # make install
# cd /usr/local # tar xzvf apache-tomcat-5.5.12.tar.gz # ln -s apache-tomcat-5.5.12 tomcat
# cd jakarta-tomcat-connectors-1.2.15-src/jk/native # ./configure --with-apxs=/usr/local/apache2/bin/apxs # make # cp ./apache-2.0/mod_jk.so /usr/local/apache2/modules/
JkWorkersFile /usr/local/apache2/conf/workers.properties
JkLogFile /usr/local/apache2/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /servlet/* worker1 JkMount /*.jsp worker1
worker.list=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 DocumentRoot "/var/wwwroot" 增加關(guān)于加載mod_jk的語句:
Include /usr/local/apache2/conf/mod_jk.conf
<Context path="" docBase="/var/wwwroot" debug="0" reloadable="true" crossContext="true"/> 在/var/wwwroot下建立一個index.jsp,啟動Apache和Tomcat,用瀏覽器訪問http://localhost/,應(yīng)該可以看到正確的頁面了。 查考文章:http://hi.baidu.com/8495138/blog/item/0942243423f05d3a5bb5f5b1.html |
聯(lián)系客服