打开 Apache 安装目录的 conf 文件夹(linux 在 /etc/httpd/conf 或者 /usr/local/apache/conf)

打开 httpd.conf

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

前面的注释去掉

在 httpd.conf 最后添上

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.linuxidc.com
ServerAlias www.linuxidc.com
ProxyRequests Off
<Proxy http://www.linuxidc.com>
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Proxy>
ProxyPass / http://61.191.191.4:9002/
ProxyPassReverse / http://61.191.191.4:9002/
</VirtualHost>

<VirtualHost *:80>
ServerName img.linuxidc.com
ServerAlias img.linuxidc.com
ProxyRequests Off
<Proxy http://img.linuxidc.com>
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Proxy>
ProxyPass / http://61.191.191.4:9003/
ProxyPassReverse / http://61.191.191.4:9003/
</VirtualHost>

CentOS 6.2 编译安装Squid 配置反向代理服务器 http://www.linuxidc.com/Linux/2012-11/74529.htm

简单配置Squid代理和反向代理 http://www.linuxidc.com/Linux/2014-04/99465.htm

RHEL6.4 搭建Nginx反向代理服务器 http://www.linuxidc.com/Linux/2014-05/102219.htm

Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm

CentOS 5.9下编译安装LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm

本文永久更新链接地址http://www.linuxidc.com/Linux/2014-06/102751.htm