How to use Apache proxy function to realize the asynchronous storage of website resources

Source: Internet
Author: User
Tags mkdir

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.