Using Squid to build proxy servers under Linux

Source: Internet
Author: User
Tags linux

First, what is ProxyServer (proxy server), the role of proxy

In the real world we often go to help others do things, such as to help people pay electricity or something, in this case you are not the owner of the meter, but the agent (agents) identity. In the Internet world, Proxy is the equivalent of the people who pay the electricity bill, when we send a connection request, will be through proxy to help us directly with the target server communication, to help us obtain information.

The client uses the ProxyServer to surf the Internet with the following steps:

①client the server to send a request.

②server receives the request to compare to judge the cache in the presence of the client want the information, if not the remote server to send data requests.

③ the requested data into the cache, and then transmits the data to the client side.

④ when the client sends the requested data in the cache, the data in the cache is transmitted directly to the client side.

Although when the first access to the proxy request data cache is not, the proxy crawl data will be saved in the cache, so that the speed of access slows down, but the second visitors and later visitors need the information, proxy do not want to remote server request, The data in the cache is sent directly to the subsequent requester, which reduces the traffic to the remote server, and the transmission is faster because the proxy is local.

Second, the use of squid in the construction of ProxyServer

In this article, the author uses the environment is:

Operating system: Redhat9.0, Kernel: 2.4.20-31.9, other system kits have been updated to the latest via apt.

1. Compile and install Squid

Because squid on the system hardware requirements are relatively high, so we should try to optimize the installation.

CODE: #groupaddsquid

#useraddsquid

Add suqid users and user groups

CODE: #exportCFLAGES = '-o2-mcpu=pentium4-march=pentium4-mmmx-msse-msse2 '

You can choose the appropriate parameters according to your CPU GCC-3.1 above can be optimized for the CPU:

CODE:Pentium2: -O2 -mcpu=i686 -march=i686 -mmmx
Pentium3: -O2 -mcpu=pentium3 -march=pentium3 -mmmx -msse
Pentium4: -O2 -mcpu=pentium4 -march=pentium4 -mmmx -msse -msse2 
#./configure --prefix=/usr/local/squid --enable-gnuregex --enable-async-io=80
--enable-icmp --enable-kill-parent-hack --enable-snmp
--disable-ident-lookups --enable-cahce-digests
--enable-arp-acl --enable-err-language="Simplify_Chinese"
--enable-default-err-languages="Simplify_Chinese" 
--enable-poll --enable-linux-netfilter --enable-underscore
#make
#make install

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.