[不指定 2007/08/10 23:22 | by 逍遥花主 ]

D 安装JK

  1. # cd /usr/local/
  2. # tar xzvf jakarta-tomcat-connectors-1.2.14-src.tar.gz
  3. # cd jakarta-tomcat-connectors-1.2.14-src/jk/native
  4. # chmod 755 buildconf.sh
  5. # ./buildconf.sh
  6. # ./configure --with-apxs=/usr/local/apache/bin/apxs
  7. # make
  8. # make install
  9. # cd /usr/local/jakarta-tomcat-connectors-jk1.2.14-src/jk/native/apache-2.0/
  10. # cp mod_jk.so /usr/local/apache/modules/

E 系统整合

  1. # vi /usr/local/apache/conf/httpd.conf

在文件最末尾加上如下语句

  1. #Load mod_jk
  2. LoadModule jk_module modules/mod_jk.so
  3. # Configure mod_jk
  4. JkWorkersFile conf/workers.properties
  5. JkLogFile logs/mod_jk.log
  6. JkLogLevel info
  7. JkMount /*.jsp loadbalancer
  8. JkMount /servlet/* loadbalancer
  9. JkMount /application/* loadbalancer
  10. #vi /usr/local/apache/conf/workers.properties
  11. 添加下列语句
  12. #
  13. # workers.properties
  14. #
  15. # In Unix, we use forward slashes:
  16. ps=/
  17. # list the workers by name
  18. worker.list=tomcat1, tomcat2, loadbalancer
  19. # ------------------------
  20. # First tomcat server
  21. # ------------------------
  22. worker.tomcat1.port=8009
  23. worker.tomcat1.host=127.0.0.1
  24. worker.tomcat1.type=ajp13
  25. # Specify the size of the open connection cache.
  26. #worker.tomcat1.cachesize
  27. #
  28. # Specifies the load balance factor when used with
  29. # a load balancing worker.
  30. # Note:
  31. # ----> lbfactor must be > 0
  32. # ----> Low lbfactor means less work done by the worker.
  33. worker.tomcat1.lbfactor=100
  34. # ------------------------
  35. # Second tomcat server
  36. # ------------------------
  37. worker.tomcat2.port=8009
  38. worker.tomcat2.host=192.168.1.34
  39. worker.tomcat2.type=ajp13
  40. # Specify the size of the open connection cache.
  41. #worker.tomcat2.cachesize
  42. #
  43. # Specifies the load balance factor when used with
  44. # a load balancing worker.
  45. # Note:
  46. # ----> lbfactor must be > 0
  47. # ----> Low lbfactor means less work done by the worker.
  48. worker.tomcat2.lbfactor=100
  49. # ------------------------
  50. # Load Balancer worker
  51. # ------------------------
  52. # The loadbalancer (type lb) worker performs weighted round-robin
  53. # load balancing with sticky sessions.
  54. # Note:
  55. # ----> If a worker dies, the load balancer will check its state
  56. # once in a while. Until then all work is redirected to peer
  57. # worker.
  58. worker.loadbalancer.type=lb
  59. worker.loadbalancer.balanced_workers=tomcat1, tomcat2
  60. #
  61. # END workers.properties
  62. #

#vi /usr/local/tomcat/conf/server.xml

  1. <Connector port="8009"
  2. protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"
  3. redirectPort="8443" protocol="AJP/1.3" />

  第101行

在119行左右加入如下语句(去注释)

  1. <Engine name="Standalone" defaultHost="localhost" jvmRoute="tomcat1"></Engine>

若第二台tomcat,将jvmRoute的修改为tomcat2

系统整合完毕

启动apache和tomcat服务

# /usr/local/apache/bin/apachectl start

# /usr/local/tomcat/bin/catalina.sh start

将如下内容添加至/etc/rc.d/rc.local文件末尾

以便系统启动后开启apache,tomcat服务

#vi /etc/rc.d/rc.local

添加

/usr/local/tomcat/bin/catalina.sh start

/usr/local/apache/bin/apachectl start

内文分页: [1] [2]
『技术文摘』 | Tags:| 评论(0) | 引用(0) | 阅读(4261)



发表评论
昵称 [注册]
网址
打开HTML 打开UBB 打开表情 隐藏 记住我