首页 > 代码库 > apache代理weblogic集群办法

apache代理weblogic集群办法

方法一:

--关闭iptables和selinux

--在apache配置文件httpd.conf最下面添加如下语句,然后重启apache:

ServerName 127.0.0.1:80

NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
        ProxyPreserveHost On
        ProxyPass / balancer://cluster/
        ProxyPassReverse / balancer://mycluster
        ServerName 127.0.0.1
        ServerAlias 127.0.0.1
</VirtualHost>

<Proxy balancer://cluster>
        BalancerMember http://192.168.100.131:8001 loadfactor=1 route=1                              
        BalancerMember http://192.168.100.133:8001 loadfactor=1 route=2
        BalancerMember http://192.168.100.135:8001 loadfactor=1 route=3

#以上3条代表负载地址
</Proxy>

 

方法二:

--在httpd.conf配置文件末尾添加如下部分,默认访问端口为linux服务器host_ip:80端口:

LoadModule weblogic_module modules/mod_wl_22.so

<IfModule mod_weblogic.c>
   WebLogicCluster 192.168.100.131:8001,192.168.100.133:8001,192.168.100.135:8001
   MatchExpression /*
</IfModule>

<Location /hqoa>
    SetHandler weblogic-handler
    WebLogicCluster 192.168.100.131:8001,192.168.100.133:8001,192.168.100.135:8001
    MatchExpression *
    MatchExpression *.*
</Location>

apache代理weblogic集群办法