环境信息
操作系统:CentOS release 7
Squid 版本:squid.x86_64 7:3.3.8-26.el7_2.4
服务器:192.168.1.1
客户端:192.168.1.10
本文仅介绍普通代理的搭建方式。相关操作步骤如下:
1. 检查squid 软件包安装其情况,如果没有则安装
1 2 |
rpm -qa|grep squid yum -y install squid |
2.编辑 squid 的主配置文件 /etc/squid/squid.conf
1 2 3 4 5 6 7 8 |
http_port 3128 cache_mem 64 MB maximum_object_size 4 MB cache_dir ufs /var/spool/squid 100 16 256 access_log /var/log/squid/access.log acl localnet src 192.168.1.0/24 #允许通过代理的地址段 http_access allow localnet http_access deny all |
3.启动服务
service squid start
4.客户端配置
linux配置环境变量
export http_proxy=192.168.1.1:3128
windows在浏览器配置代理