apache反向代理

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

后端是tomcat+web服务。并实现apache 与tomcat session共享

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集群环境

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

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。