Configuration of the agent service squid under Linux

Source: Internet
Author: User

Squid cache (for short, squid), as the server's front cache server, you can proxy users to the Web server to request data and cache, can also be used in the LAN, so that LAN users through proxy Internet.


Linux under Squid Configuration

First install Squid

Yum Install Squid

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5D/FB/wKioL1UonFDQWCTFAAD7rSztkKs274.jpg "title=" 2.PNG " alt= "Wkiol1uonfdqwctfaad7rsztkks274.jpg"/>


Squid server configuration file is mainly squid.conf

The simple proxy settings are as follows

1, ACL xx (alias, self-change according to demand) SRC 192.168.157.0/24

# ACL Baidu Dstdomain (destination domain). baidu.com (used to restrict user access)

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5E/00/wKiom1UonFHhHG5CAABtMWiEQPo626.jpg "title=" 10.PNG "alt=" Wkiom1uonfhhhg5caabtmwieqpo626.jpg "/>



2.

Http_access deny Baidu refused to visit Baidu put in front

# http_assess allow XX (alias) (note sort important)

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5E/00/wKiom1UonMOS_h6QAABnnyTec_c722.jpg "title=" 11.PNG "alt=" Wkiom1uonmos_h6qaabnnytec_c722.jpg "/>

3, Port Http_port 8080 (default port is 3128)

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5D/FB/wKioL1UonkCABJ8cAACSVT4lJ28396.jpg "title=" 12.PNG "alt=" Wkiol1uonkcabj8caacsvt4lj28396.jpg "/>


In addition, you can add the following at the end of the configuration file for basic configuration

http _Port 8080//Set the listening IP and port number

Cache_mem MB//Set the size of the memory buffer

Cache_dir Ufs/var/spool/squid 2000 16 256//set hard disk buffer size

Cache_effective_user squid//set cache for active users

Cache_effective_group squid//Set valid user groups for caching

#dns_nameservers 192.168.157.144//Set DNS server address, general can not set, default to use the server itself set DNS

Cache_access_log/var/log/squid/access.log//Set access log file

Cache_log/var/log/squid/cache.log//Set cache log file

Visible_hostname 192.168.157.144//Set Squid host name


Execute command squid-z after completion to generate basic settings

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5D/FB/wKioL1UonrrBM3R2AACZ5N4e3eY332.jpg "title=" 14.PNG "alt=" Wkiol1uonrrbm3r2aacz5n4e3ey332.jpg "/>

When finished, start service squid start


Of course, one more step. 8080 ports to open the firewall

Iptables-i INPUT 1-p TCP--dport 8080-j ACCEPT


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5D/FB/wKioL1Uonymj7cexAAFk3iD8YBY220.jpg "title=" 13.PNG "alt=" Wkiol1uonymj7cexaafk3id8yby220.jpg "/>


Testing under Windows

Open IE Settings agent

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5E/00/wKiom1UonvCiEvx-AAOjaeMHRHk146.jpg "title=" 17.PNG "alt=" Wkiom1uonvcievx-aaojaemhrhk146.jpg "/>


After Setup is complete, clients can access the Web site


If you have set a limited access to Baidu, you will not be able to open

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5D/FB/wKioL1UooLbzXpCwAAILD0cFPj0776.jpg "title=" 16.PNG "alt=" Wkiol1uoolbzxpcwaaild0cfpj0776.jpg "/>



Squid can also set the transparent proxy, which means that the client does not need to set proxy address, can use

Need to set NAT with Iptables

Add transparent to the configuration file

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5E/00/wKiom1UooHmBqvjiAADIU7BqEaI899.jpg "title=" 15.PNG "alt=" Wkiom1uoohmbqvjiaadiu7bqeai899.jpg "/>

Subsequent operations will be performed.

This article is from the "Filter New" blog, please be sure to keep this source http://wahehe.blog.51cto.com/8935316/1631175

Configuration of the agent service squid under Linux

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.