Linux Beginner-squid Agent Chapter

Source: Internet
Author: User
Tags squid proxy

Linux Beginner-squid Agent Chapter

Squid Proxy Server is a cache server, generally divided into forward proxy and reverse proxy.

1, the forward agent

Clients because of network or other problems, can not access to an Apache server, if you want to access, you need to pass through an intermediary proxy server, this is squid's forward proxy.

Squid Proxy Server can access the Apache server, and cache the contents of the content, and then the cached content to the client to see.

In order to demonstrate the need, the host "double" in this article has two network cards, one IP is "172.25.254.202", and one IP is "172.25.2.202". The IP of the host "single" Is "172.25.2.102". The Apache server is "172.25.254.2". Double is accessible to Apache and can be connected to "single". "single" can only be connected to "double" and cannot be accessed to Apache.

The Squid proxy server in this article is "double" to use "Yum install squid-y" To install squid service, for convenience, directly shut down the firewall.

The forward proxy server is configured as follows:

On the squid server side configuration. Edit Squid's configuration file "/etc/squid/squid.conf" and Change the "Deny" on line 56th to "allow". Remove the comment from line 62nd. Restart the service when you are finished.

In the client configuration. Open the browser "Firefox" in the client, click "Perferences" under "Edit" in the upper left corner, click "Network" under "Advanced", then click "Settings" after "Connetion". According to the input IP and port number, IP is the squid server and its own network segment IP, the port number is 3128.

Once you have completed the above configuration, you can see this page by re-entering "172.25.254.2" in the "single" client's browser.

The proxy client is accessing the Squid server cache, which is suitable for clients that do not have direct access to the target home page and require an intermediate server squid.

2. Reverse Proxy

The reverse proxy is the client access to the target is the squid server, squid server through the access of Apache host and cache its Web page content, and then feedback to the client, the client will still see the squid server cache, but unlike the forward proxy, The client in the reverse proxy is unaware of the presence of the Apache host and directly accesses the squid server, and the client does not need to set it up. Reverse proxies are typically used for Apache access acceleration and to reduce access pressure on Apache hosts.

The reverse proxy server is configured as follows:

On the squid server side configuration. Edit the configuration file "/etc/squid/squid.conf", Change "3128" in line 59th to "80" and add "Vhost Vport" to the 58th line, adding "Cache_peer 172.25.254.2 Parent 80 0 Proxy-only ". After completion, restart the "squid" service.

The reverse proxy does not need to be configured on the client.

It is important to note that there is no Apache on the squid server.

After completing the above configuration, in the client's browser, directly enter the squid server to access "172.25.2.202", you can see the Apache host "172.25.254.2" home page.

The above is the Squid Proxy server commonly used in the forward and reverse proxy, this proxy server is common in the network.

Linux Beginner-squid Agent Chapter

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.