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

时间:2023-03-10 02:31:36
今天知道了一个 反向代理,是apache  的一个功能,这里记录一下

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

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

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