CDN full-network acceleration using multiple servers in the Squid cluster

Source: Internet
Author: User
Tags server array
First, we need to create a server group and then use Squid to reverse cache Port web80 to accelerate our website. major portal websites such as 163, sina, and chinaitlab are basically using this technology. the advantage is that it has a great advantage. For example, it accelerates the network and protects against hackers (because they see CDN hosts). This is a reverse set using Squid.

First create a server group and then use Squid to reverse cache Port web80 to accelerate your website.

Similar technologies such as 163, sina, and chinaitlab are basically used, and the benefits are great. For example, it accelerates the network and protects against hackers (because they see CDN hosts)
This is an application that uses the Squid reverse cluster mode.
Network environment:
Master server group: Source Web server group located in public ip: 220. XXX. XXX. X port: 80 (the backend is the WEB server)
Note: ensure that TCP80 and UDP3130 are enabled on the firewall (for icp_port Communications, multiple Squid clusters will be used)
Sub-servers across the country: server A's public network IP111.xxx. xxx. x
Server B public network ip112.xxx. xxx. x
Note: ensure that TCP80 and UDP3130 are enabled on the firewall (for icp_port Communications, multiple Squid clusters will be used)
........................
Problems to be solved:
All users throughout the country, whether telecom or China Netcom, can access websites at a high speed.
Implementation
1. install Squid on the master server group and three servers distributed across the country. if the Squid is not installed, close this page.
2. configure Squid separately. here, only the configuration points of the Squid cluster are described.
Configure Squid for the master server group:
Http_port 220. XXX. XXX. X: 80 vhost vport # let Squid listen to port 80 of the local ip address
Icp_port 3130 # Use of multiple squids for communication
Cache_peer "intranet web server address" parent 80 0 no-query originserver no-digest name = cache0 # set the ip address and port of the source Web Server Group
Cache_peer 220. XXX. XXX. X sibling 80 3130 name = cache1 # Let the remote squid connect to the local Squid in sibling mode and specify its port
Cache_peer 111. xxx. xxx. x sibling 80 3130 name = cache2 # server
Cache_peer 112. xxx. xxx. x sibling 80 3130 name = cache3 # server B
Cache_peer_domain cache0 www.php-oa.com # configure the domain name that the local squid allows access
Acl Safe_ports port 80
Acl Safe_ports port 3130 # Allow the proxy of the above port
Configurations of server Squid across China:
Server:
Http_port 111. xxx. xxx. x: 80 vhost vport
Icp_port 3130
Cache_peer 220. xxx. xxx. x parent 81 0 no-query originserver no-digest name = cache0 # set the master server group Web server as the source server
Cache_peer 111. xxx. xxx. x sibling 80 3130 name = cache1
Cache_peer 220. xxx. xxx. x sibling 80 3130 name = cache2
Cache_peer 112. xxx. xxx. x sibling 80 3130 name = cache3
Cache_peer_domain cache0 www.php-oa.com
Acl Safe_ports port 80
Acl Safe_ports port 3130
Server B:
Http_port 112. xxx. xxx. x: 80 vhost vport
Icp_port 3130
Cache_peer 220. xxx. xxx. x parent 80 0 no-query originserver no-digest name = cache0
Cache_peer 112. xxx. xxx. x sibling 80 3130 name = cache1
Cache_peer 220. xxx. xxx. x sibling 80 3130 name = cache2
Cache_peer 111. xxx. xxx. x sibling 80 3130 name = cache3
Cache_peer_domain cache0 www.php-oa.com
Acl Safe_ports port 80
Acl Safe_ports port 3130
Even though the configuration is complete, how can we allow Telecom and China Netcom users to access two different images? Please check the relevant information, do not apply to the https://www.dnspod.com dual-line, China Telecom Netcom forwarding service
Note: The following describes the cache_peer parameters.
Use the cache_peer option in the squid. conf configuration file to configure the proxy server array
Other options are used to control the method of proxy partner selection. The format of Cache_peer is as follows:
Cache_peer hostname type http_port icp_port
You can configure five options in total:
1. hostname: The requested sub-proxy server or parent proxy server. The host name or IP address can be used;
2. type: specifies the hostname type, whether it is a child proxy server of the same level or a parent proxy server, that is, parent (parent) or sibling (child );
3. http_port: Listener port of hostname;
4. icp_port: indicates the ICP listening port on the hostname. if you do not support the ICP protocol, you can specify 7;
5. options: contains one or more keywords.
Options may have the following keywords:
1. proxy-only: indicates that the data obtained from the peer is not cached locally. by default, squid is used to cache the data;
2. weight = n: When you have multiple peers, if more than one peer has the data you requested, squid determines the weight value by calculating the ICP response time of each peer, and then squid sends an ICP request to the peer with the maximum weight. That is, the higher the weight value, the higher the priority. Of course, you can also manually specify its weight value;
3. no-query: Do not send an ICP request to the peer. If the peer is unavailable, you can use this option;
4. Default: it is a bit like the Default route in the route table. This peer will be used as the final attempt. You can use the default and
The no-query option sends all requests to the parent proxy server;
5. login = user: password: This option can be used for authentication when your parent proxy server requires user authentication.

Related Article

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.