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

今天知道了一个 反向代理,是apache 的一个功能,这里记录一下

时间:2015-09-15 21:55:08      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:

什么事情都需要自己 去弄,记住了这句话,不要以为 别人会来帮你

在 apache 的http.conf 文件中(去掉注释)

LoadModule proxy_module modules/mod_proxy.so (这句是编译激活时产生的)
LoadModule proxy_http_module modules/mod_proxy.so (这句是要手动添加的)

添加

NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
ServerName www.a.org
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://192.168.0.115/
ProxyPassReverse / http://192.168.0.115/
</VirtualHost>
 
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
ServerName www.b.org
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1:9000/
ProxyPassReverse / http://127.0.0.1:9000/
</VirtualHost>
 
我这个名词是和一个网友学的,很感谢这个网友。真的很感谢
 
 
 
这是我今天弄得
NameVirtualHost *:80
<VirtualHost *:80>
ServerName 域名:80
ServerAlias 域名DocumentRoot "d:/AppServ/www"

    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn‘t give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks MultiViews ExecCGI


    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All


    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

 

 

<VirtualHost *:80>
    ProxyRequests Off
    ServerName 域名2:80
    ServerAlias 域名2
ProxyPass / http://ip+端口/ ProxyPassReverse / http://ip+端口/
</VirtualHost>

以后记住了,不要再问了,自己来解决

 

今天知道了一个 反向代理,是apache 的一个功能,这里记录一下

标签:

原文地址:http://www.cnblogs.com/woxiangxintj/p/4811344.html

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