ee900 回復于:2004-12-09 20:32:34 |
apache與tomcat整合
ee900 于 2004年 12月06日 發表 我用的是module_jk2方式 1. 停止apache和tomcat 2.下載: http://apache.osuosl.org/jakarta/tomcat-connectors/jk2/ 我下的是 jakarta-tomcat-connectors-jk2-src-current.tar.gz 是source包 3. 安裝: 在/tmp中解壓 tar zxvf jakarta-tomcat-connectors-jk2-src-current.tar.gz cd ./jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2 ./buildconf.sh 4. 編輯編譯配置文件: cd .. cp ./build.properties.sample ./build.properties vi build.properties 更改如下: tomcat41.home=/misc/tomcat apache2.home=/usr/local/apache 5. 配置,生成編譯選項: cd native2 ./configure --with-apxs2="/usr/local/apache/bin/apxs" -enable-EAPI 6. 編譯,連接,把源代碼變成本地二進制碼: make 7. 移動整合插件: cd .. cp ./build/jk2/apache2/mod_jk2.so /usr/local/apache/modules 8. 編輯httpd.conf 改成: LoadModule jk2_module modules/mod_jk2.so 9. 測試模塊能否正常加載: cd /usr/local/apache ./bin/apachectl configtest 如果能正常加載,會出現: Syntax OK 10. 編輯/usr/local/apache/conf/worker2.properties 如下: (2.0.49) [shm] info=Scoreboard. Requried for reconfiguration and status with multiprocess servers. file=anon # Defines a load balancer named lb. Use even if you only have one machine. [lb:lb] # Example socket channel, override port and host. [channel.socket:localhost:8009] port=8009 host=127.0.0.1 # define the worker [ajp13:localhost:8009] channel=channel.socket:localhost:8009 group=lb # Map the Tomcat examples webapp to the Web server uri space [uri:/examples/*] group=lb [status:] info=Status worker, displays runtime information [uri:/jkstatus/*] info=The Tomcat /jkstatus handler group=status: 11. 編輯/misc/tomcat/conf/server.xml 看是否有對8009端口的定義,如下: port="8009" minProcessors="5" maxProcessors="75" enableLookups="true" redirectPort="8443" aclearcase/" target="_blank" >cceptCount="10" debug="0" connectionTimeout="0" useURIValidationHack="false" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/> 12.啟動服務: 先啟動tomcat,再啟動apache 13.測試: url "localhost" url "localhost/examples" |
原文轉自:http://www.anti-gravitydesign.com