Chinaunix首页 | 论坛 | 博客
  • 博客访问: 287449
  • 博文数量: 73
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 452
  • 用 户 组: 普通用户
  • 注册时间: 2014-09-22 17:07
个人简介

心态决定命运

文章分类

全部博文(73)

文章存档

2017年(21)

2016年(27)

2015年(21)

2014年(4)

我的朋友

分类: LINUX

2015-10-29 16:23:41

环境 :

点击(此处)折叠或打开

  1. [root@JUN bin]# uname -a
  2. Linux JUN 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  3. [root@JUN bin]# ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:0C:29:75:66:34  
              inet addr:192.168.125.128  Bcast:192.168.125.255  Mask:255.255.255.0
              inet6 addr: fe80::20c:29ff:fe75:6634/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:51482 errors:0 dropped:0 overruns:0 frame:0
              TX packets:44049 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:8398647 (8.0 MiB)  TX bytes:16283801 (15.5 MiB)

    eth0:0    Link encap:Ethernet  HWaddr 00:0C:29:75:66:34  
              inet addr:192.168.125.133  Bcast:192.168.125.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
apache

点击(此处)折叠或打开

  1. [root@JUN bin]# ./httpd -version
  2. Server version: Apache/2.4.17 (Unix)
  3. Server built: Oct 22 2015 14:17:02
jboss

点击(此处)折叠或打开

  1. JBoss 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)
 jk :tomcat-connectors-1.2.41-src.tar.gz
前期准备
1. apache 使用运行zabbix 的(未重新安装)
2. jboss 部署两个 , AJP 端口分别为 8009 、8109,打开server.xml access日志 ,用以查看请求访问情况
注:此版本jboss  端口修改 主要是以下两个文件
       1) server/default/deploy/jbossweb.sar/server.xml
       2) server/default/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml
JK配置
1. 解压 tomcat-connectors-1.2.41-src.tar.gz      
2. 编译生成mo_jk.so ,如果apache/modules 目录没有生成mod_jk.so ,可以从tomcat-connectors-1.2.41-src/native/apache-2.0拷贝过去

点击(此处)折叠或打开

  1. tar -zxvf  解压 tomcat-connectors-1.2.41-src.tar.gz
  2. cd tomcat-connectors-1.2.41-src/native
  3. ./configure --with-apxs=/usr/local/apache/bin/apxs
  4. make && make install
  5. [root@JUN modules]# ll mod_jk.so
    -rwxr-xr-x 1 root root 1143282 Oct 29 15:55 mod_jk.so

3. copy jk配置文件
   

点击(此处)折叠或打开

  1. cp tomcat-connectors-1.2.41-src/conf/* /usr/local/apache/conf
修改相关配置如下:
workers.properties

点击(此处)折叠或打开

  1. [root@JUN conf]# egrep -v '^#|^$' workers.properties
  2. worker.list=jk-status
  3. worker.jk-status.type=status
  4. worker.jk-status.read_only=true
  5. worker.list=jk-manager
  6. worker.jk-manager.type=status
  7. worker.list=balancer
  8. worker.balancer.type=lb
  9. worker.balancer.error_escalation_time=0
  10. worker.balancer.max_reply_timeouts=10
  11. worker.balancer.balance_workers=node1
  12. #此处为属性继承
  13. worker.node1.reference=worker.template
  14. worker.node1.host=192.168.125.128
  15. worker.node1.port=8009
  16. worker.node1.activation=A
  17. worker.balancer.balance_workers=node2
  18. worker.node2.reference=worker.template
  19. worker.node2.host=192.168.125.133
  20. worker.node2.port=8109
  21. worker.node2.activation=A
  22. worker.template.type=ajp13
  23. worker.template.socket_connect_timeout=5000
  24. worker.template.socket_keepalive=true
  25. worker.template.ping_mode=A
  26. worker.template.ping_timeout=10000
  27. worker.template.connection_pool_minsize=0
  28. worker.template.connection_pool_timeout=600
  29. worker.template.reply_timeout=300000
  30. worker.template.recovery_options=3
uriworkermap.properties

点击(此处)折叠或打开

  1. [root@JUN conf]# egrep -v '^#|^$' uriworkermap.properties
  2. /admin/*=balancer
  3. /manager/*=balancer
  4. /*=balancer
  5. ##此处zabbix相关请求不做分发
  6. !/zabbix/*=balancer
  7. /jk-manager=jk-manager
  8. /jk-status=jk-status
httpd-jk.conf

点击(此处)折叠或打开

  1. [root@JUN conf]# egrep -v '^#|^$|^ #' httpd-jk.conf
  2. LoadModule jk_module modules/mod_jk.so
  3. <IfModule jk_module>
  4.     JkWorkersFile conf/workers.properties
  5.     JkLogFile logs/mod_jk.log
  6.     JkLogLevel info
  7.     JkShmFile logs/mod_jk.shm
  8.     JkWatchdogInterval 60
  9.     <Location /jk-status>
  10.         # Inside Location we can omit the URL in JkMount
  11.         JkMount jk-status
  12.         Order deny,allow
  13.         Deny from all
  14.         Allow from 172.26.1.54
  15.     </Location>
  16.     <Location /jk-manager>
  17.         # Inside Location we can omit the URL in JkMount
  18.         JkMount jk-manager
  19.         Order deny,allow
  20.         Deny from all
  21.         Allow from 172.26.1.54
  22.     </Location>
  23.     JkMountFile conf/uriworkermap.properties
  24. </IfModule>
httpd.conf Include 部分添加  Include conf/httpd-jk.conf

最后启动apache 、jboss 测试

阅读(1377) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~