A summary of using SQUID to build HTTP agent on CentOS

Source: Internet
Author: User
Tags iptables

Install Squid

Yum install squid-y

#-y represents automatic selection y, automatic installation
After installation, you can customize the HTTP proxy port, set the source IP white list, etc.
vi/etc/squid/squid.conf

#------Custom HTTP port:

# Squid normally listens to port 3128
http_port 8088

#----- -Set source IP Whitelist, add these two lines to the http_access deny all front

ACL client src 122.55.87.125
http_access allow client # and

final Ly deny all other access to this proxy
http_access deny all
The time in the access log for the default squid is a Unix timestamp, which is inconvenient to read and can be added by adding one line of Logformat configuration in/etc/squid/squid.conf:
#此行加在配置文件末尾即可
#access Log time human-readable
Logformat squid%tl.%0 3tu%6tr%>a%ss/%03>hs%<st%rm%ru%un%sh/%<a%mt
After the configuration file has been modified, reload can take effect:
/etc/init.d/squid Reload

#另外启动和重启命令
/etc/init.d/squid start
/etc/init.d/squid restart
If you want to restrict the white list IP Access Proxy port at the firewall level only:
Vi/etc/sysconfig/iptables

-A input-s 122.55.87.125-p tcp-m tcp--dport 8088-j ACCEPT

service iptables restart

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.