System environment: CentOS 6.3 x64
apache:http-2.4.2
Proxy side, Web server (192.168.7.12):
# mkdir/usr/local/apache2/htdocs/files.abc.cn/
First, remove the comment for module under the main configuration file http.conf
# vi/usr/local/apache2/conf/http.conf
Find the following 3 lines, remove the # annotation
-----------------
LoadModule Proxy_module modules/mod_proxy.so
LoadModule Proxy_http_module modules/mod_proxy_http.so
Include conf/extra/httpd-vhosts.conf
-----------------
Enter Virtual Host configuration:
# vi/usr/local/apache2/conf/extra/httpd-vhosts.conf
<virtualhost *:80>
This column more highlights: http://www.bianceng.cn/Servers/web/
DocumentRoot "/usr/local/apache2/htdocs/files.abc.cn/"
Serveralias files.abc.cn
proxypass/http://192.168.7.11/
</VirtualHost>
By proxy end, file server (192.168.7.11):
# vi/usr/local/apache2/conf/http.conf
Find the downside, get rid of the # Note
-----------------
Include conf/extra/httpd-vhosts.conf
-----------------
Enter Virtual Host configuration:
# mkdir/usr/local/apache2/htdocs/files.abc.cn/
# vi/usr/local/apache2/conf/extra/httpd-vhosts.conf
-----------------
<virtualhost *:80>
DocumentRoot "/usr/local/apache2/htdocs/files.abc.cn/"
Serveralias 192.168.7.11
</VirtualHost>
-----------------
Configuration complete
This way the client browser accesses the domain name http://files.abc.cn
The HTTP proxy allows access to resources on the 192.168.7.11
So as to realize the asynchronous storage access of the website resources, alleviate the primary server access pressure.