Article Title: create a fully-monitored Squid proxy server. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The proxy server is used to obtain network information from a proxy network user. It is a transfer station for network information. With the widespread use of proxy servers, a series of security problems emerge. Because the access control policy of the proxy server is not configured in detail, users can freely access many pornographic and reactionary illegal sites through the proxy server, these actions are often difficult to track and cause great inconvenience to management.
Deploy the Squid Server
1. Comparison of various proxy servers
There are many agent server software in Linux, but it is widely used only by Squid, socks, Apache and other practices that prove to be a high-performance agent software. Next we will compare these software, as shown in 1.
Comparison of mainstream proxy servers in Linux
Although the categories listed above are not comprehensive, we can also see what kind of proxy server is widely used by users. Squid is the agent server software for caching Internet Data in Linux. It receives user download requests and automatically processes the downloaded data. That is to say, when a user wants to download a home page, he can send an application to Squid to download it instead of Squid. Then Squid connects to the requested website and requests the home page, the home page is sent to the user and a backup is retained. When another user applies for the same page, Squid immediately transmits the saved backup to the user, making the user feel that the speed is quite fast. Currently, Squid can proxy HTTP, FTP, GOPHER, SSL, and WAIS protocols. It cannot proxy POP3, NNTP, and other protocols. Squid can work in many operating systems, such as AIX, Digital, Unix, FreeBSD, HP-UX, Irix, Linux, NetBSD, Nextstep, SCO, Solaris, OS/2, etc. Squid supports the following protocols:
Client protocols: HTTP, FTP, Gopher, WAIS, and SSL
Cache and Management Protocols: ICP, Cache Digests, SNMP, and HTCP
2. Working Principle and flowchart of Squid
1) Working Mechanism of the proxy server
The working mechanism of the proxy server is very similar to the agents we often mention in our lives. Assume that your own machine is server A. The data you want to obtain is provided by server B, and the proxy server is server C, the specific connection process is like this. First, machine A requires data from machine B. Machine A directly establishes A connection with machine C. Machine C receives data requests from machine A and establishes A connection with machine B, download the data on machine B requested by machine A to the local device, and then send the data to machine A to complete the proxy task.
2) Squid Workflow
Working principle of Squid
◆ The client computer sends a data request packet to the proxy server;
◆ After receiving the packet, the proxy server compares the "Source" of the packet with the expected "target" website to be accepted? If both the source and target are valid, the proxy server is expected to start obtaining information for the client computer.
◆ The proxy server first goes to its own hard disk, that is, the so-called cache (cache) to check whether there is any data required by the client computer. If yes, send the data directly to the client computer without obtaining information from the Internet.
◆ Send data back to the client computer for use.
◆ After the above three searches, the proxy server requests data from the target website on the Internet if no data is cached or the data expires;
◆ After the data is retrieved, the proxy server first saves the obtained data to the cache.
◆ Finally, the data is sent back to the client computer for use.
[1] [2] [3] [4] [5] Next page