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