码迷,mamicode.com
首页 > Web开发 > 详细

apache反向代理

时间:2016-03-12 06:58:18      阅读:429      评论:0      收藏:0      [点我收藏+]

标签:apache

#www.oldboyedu.com     proxy    demo

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_connect_module modules/mod_proxy_connect.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so

LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so

LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so

LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

ProxyRequests Off

<Proxy balancer://mycluster>

BalancerMember http://192.168.56.11:8080

BalancerMember http://192.168.56.12:8080

</Proxy> 

ProxyPass   /demo   balancer://mycluster

ProxyPassReverse   /demo  balancer://mycluster

<Location /manager>

    SetHandler balancer-manager

    Order Deny,Allow

    Allow from all

</Location>



#www.oldboyedu.com     proxy    demo

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_connect_module modules/mod_proxy_connect.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so

LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so

LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so

LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

ProxyRequests Off

<Proxy balancer://mycluster>

BalancerMember http://192.168.56.11:8080

BalancerMember http://192.168.56.12:8080

</Proxy> 

#ProxyPass   /demo   balancer://mycluster

#ProxyPassReverse   /demo  balancer://mycluster

<Location /manager>

    SetHandler balancer-manager

    Order Deny,Allow

    Allow from all

</Location>

<VirtualHost *:80>

    ServerAdmin 406564728@qq.com

    DocumentRoot "/opt"

    ServerName www.oldboyedu.com

    ServerAlias oldboyedu.com

    ErrorLog "logs/www.oldboyedu.com-error_log"

    CustomLog "logs/www.oldboyedu.com-access_log" common

    ProxyPass   /   balancer://mycluster

    ProxyPassReverse   /  balancer://mycluster

</VirtualHost>


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

apache反向代理

标签:apache

原文地址:http://chenjisong.blog.51cto.com/7858025/1750114

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!