apache配置正向代理,实现通过服务器ip访问某个指定网站
apache需要加载代理模块
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
然后修改httpd-vhost.conf配置文件,实现代理转发功能.
Listen 3909 NameVirtualHost *:3909 <VirtualHost *:3909> ProxyRequests On ProxyVia On ProxyTimeout 60 AllowCONNECT 9445 8181 8051 443 8001 80 8005 8500 37031 37032 KeepAlive off LogLevel emerg CustomLog /dev/null common ErrorLog /dev/null <Proxy *> Order deny,allow Deny from all Allow from all </Proxy> </VirtualHost>