1.Squid 服务程序软件包在正确安装并启动后,Squid 代理服务器修改配置文件,重启服务,http_access allow all允许所有访问。
[root@dsrw ~]# vim /etc/squid/squid.conf
# And finally deny all other access to this proxy
http_access allow all
# Squid normally listens to port 3128
http_port 3128
# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 100 16 256
[root@dsrw ~]# systemctl restart squid
[root@dsrw ~]# systemctl enable squid
Created symlink /etc/systemd/system/multi-user.target.wants/squid.service → /usr/lib/systemd/system/squid.service.
备注:http_access allow all允许所有网段访问,可修改为仅允许192.0.0.0/8网段访问
acl localnet src 192.0.0.0/8
http_access allow localnet
http_access deny all
2.Squid 代理服务器设置防火墙
[root@dsrw ~]# firewall-cmd --permanent --add-service=squid
success
[root@dsrw ~]# firewall-cmd --permanent --add-port=3128/tcp
[root@dsrw ~]# firewall-cmd --reload
3.客户机浏览器设置代理并访问网页
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容