entos7.1安装squid高匿代理ip服务

entos7.1安装squid高匿代理ip服务

爬虫需要变换ip突破封锁,adsl拨号vps有大量的有用的ip,用作爬虫代理效果甚佳。

取一台拨号vps,安装squid

yum install -y epel-release
yum update -y
yum install squid

修改配置文件

vi /etc/squid/squid.conf

进入后以下部分注意修改

# Squid normally listens to port 3128,可以改变默认端口
http_port 3128 
# Uncomment and adjust the following to add a disk cache directory.
cache_mem 96 MB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /tmp/squid 100 16 256 # Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
# 配置高匿,不允许设置任何多余头信息,保持原请求header,可在最后加上此两句
request_header_access Via deny all
request_header_access X-Forwarded-For deny all

初始化缓存

squid -z

启动squid服务

service squid restart
原文地址:https://www.cnblogs.com/chengfengchi/p/13186405.html