apache反向代理,web,tomcat集群,weblogic集群

<VirtualHost *:80>

    ServerName mccbbgold.chinamworld.cn

    ProxyPass /                 ajp://172.17.10.13:8009/

    ProxyPassReverse  /         ajp://172.17.10.13:8009/

    ErrorLog logs/oto-error.log

    CustomLog logs/oto-access.log common

</VirtualHost>

后端是tomcat.

<VirtualHost *:80>

    ServerName vipclub.jiumei.com

    ProxyRequests off

    ProxyVia On

    ProxyPreserveHost On

    ProxyPass / balancer://vipclub/ stickysession=PHPSESSIONID|phpsessionid

    ProxyPassReverse / balancer://vipclub/ stickysession=PHPSESSIONID|phpsessionid

    <Proxy balancer://vipclub>

    #BalancerMember 
http://172.17.10.15
 loadfactor=100

    BalancerMember 
http://172.17.10.139
 loadfactor=100

    </Proxy>

    Include /var/www/vhost/paybest_log.conf

    ErrorLog logs/vipclub-error.log

    CustomLog logs/vipclub-access_log combined

</VirtualHost>

后端是web服务

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName www.we360.cn
    ProxyRequests off
    ProxyVia On
    ProxyPreserveHost On
    ProxyPass /ykt balancer://ykt/ lbmethod=bytraffic
    ProxyPass /  balancer://test/ stickysession=JSESSIONID nofailover=Off
    ProxyPassReverse / balancer://test/
    <Proxy balancer://ykt>
    BalancerMember http://172.17.10.121:/yikatong/yikatong/view
   </Proxy>
    <Proxy balancer://test>
    BalancerMember ajp://172.17.10.114:8009 route=tomcat1
    BalancerMember ajp://172.17.10.115:8009 route=tomcat2 
   </Proxy>
ErrorLog logs/we360ssl_error_log
TransferLog logs/we360ssl_access_log
</VirtualHost>

nofailover=Off  session 绑定成功  nofailover=On 则每次跳转到不同的tomcat上

对二级目录的转发,用户访问www.we360.cn/ykt 会跳转到web服务器上。

 

测试方法:在tomcat 目录上创建 jsp脚本

[root@wyh ~]# cd /opt/tomcat/webapps/test/
[root@wyh test]# ls
test.jsp
[root@wyh test]# cat test.jsp 
<html>
<head>
  <title>helloapp</title>
</head>
<body>
<%
System.out.println("call test.jsp");
%>   
SessionID: <%=session.getId() %>  
</body>
</html>
[root@wyh test]#
<VirtualHost *:80>

ServerName payment.paybest.cn

<Location />

SetHandler weblogic-handler

<IfModule mod_weblogic.c>

WeblogicCluster 172.17.10.141:7034,

WebLogicPort 7034

MatchExpression /ABCPayment/*

</IfModule>

</Location>

Include /var/www/vhost/JSESSIONID_log.conf

ErrorLog logs/newabcpay_error.log

CustomLog logs/newabcpay_access.log combined

</VirtualHost>

后端是weblogic服务

<VirtualHost *:80>

ServerName ccbair.paybest.cn

<IfModule mod_weblogic.c>

# WeblogicCluster 172.17.10.141:8004,172.168.123.140:8004,

# WeblogicCluster 172.168.123.140:8004,

WeblogicCluster 172.17.10.141:8004

WebLogicPort 8004

ConnectTimeoutSecs 1800

ConnectRetrySecs 2

KeepAliveEnabled ON

KeepAliveSecs 25

Debug ON

DebugConfigInfo ON

#MatchExpression /aa/*.*

#MatchExpression /aa/*

<Location /ticket>

SetHandler weblogic-handler

</Location>

</IfModule>

Include /var/www/vhost/JSESSIONID_log.conf

ErrorLog logs/ccbticket_error.log

CustomLog logs/ccbticket_access.log combined

</VirtualHost>

weblogic集群环境

本文出自 “晴空” 博客,谢绝转载!

你可能感兴趣的:(apache,tomcat,集群,weblogic)