对于在debian8上安装apache2的服务器,两个导入configuration文件如下。
这是/etc/apache2/mods-enabled/proxy.conf
文件。
<IfModule mod_proxy.c> SSLProxyEngine On SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off <Proxy *> Order deny,allow Deny from all </Proxy> ProxyVia block </IfModule>
这是/etc/apache2/sites-enabled/000-default.conf
文件。
ServerName www.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html SSLProxyEngine On SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off SSLProxyEngine ON ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined
vps_ip中的转发代理仍然有效,为什么?
curl -x vps_ip:80 -I yahoo.com #perform on local pc HTTP/1.1 200 OK
为什么不能在vps上closures转发代理?
ProxyRequests off
这是不允许正向代理服务器的指令,请注意,这是默认closures的,所以您可能已经在其他地方“开启”了。
像<Proxy *>
这样的指令条目也没什么意义,除非你想允许正向代理。