Squid代理服务——正向代理
1、安装squid
yum -y install squid
systemctl start squid
systemctl status squid
curl -x http://127.0.0.1:3128 https://www.httpbin.org/get
systemctl restart squid
squid -k parse
2、修改配置文件
vim /etc/squid/squid.f
http_port 9007
request_header_access Via deny all
request_header_access X-Forwarded-For deny all
acl localnet src 具体的IP
http_access allow localhost manager
http_access deny manager
http_access allow localhost
access_log /data/logs/applogs/squid/access.log squid
cache_log /data/logs/applogs/squid/cache.log
cache_store_log /data/logs/applogs/squid/store.log
cache_swap_log /data/logs/applogs/squid/swap.log
3、squid.f中的配置文件的日志文件,squid可能无权访问,需要授权给squid
chown squid.squid -R /data/logs/applogs/squid