宜昌本地软件开发与弱电工程服务商
项目咨询 · 快速响应

[apache]基于apache配置反向代理的实现

2016-10-13 00:16:48 点击量:24 标签: 收藏本文

http.conf

去掉前面的#号

  1. LoadModule proxy_module modules/mod_proxy.so 
  2. LoadModule proxy_http_module modules/mod_proxy_http.so 

然后在vhosts.conf配置文件里加入如下代码

  1. <VirtualHost *:80> 
  2.     DocumentRoot "D:\webser\www" 
  3.     ServerName test.com 
  4.     ServerAlias  
  5.     ErrorLog  "logs/test.com.error.log" 
  6.     CustomLog "logs/test.com.access.log" common 
  7.   <Directory "D:\webser\www"> 
  8.       Options FollowSymLinks ExecCGI 
  9.       AllowOverride All 
  10.       Order allow,deny 
  11.       Allow from all 
  12.       Require all granted 
  13.   </Directory> 
  14.   ProxyPass / http://123.123.123.123:565/ 
  15.   ProxyPassReverse / http://123.123.123.123:565/ 
  16. </VirtualHost> 

[apache]基于apache配置反向代理的实现