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" |