超简单--搭建http、https代理服务器

搭建http、https代理服务器

服务器配置

yum install -y squid

vim /etc/squid/squid.conf

#默认是3128
http_port 3228
#http_access deny all  #注释掉该行
http_access allow all # 添加 ,为容许全部ip

systemctl start squid
systemctl status squid
systemctl enable squid

日志位置
/var/log/squid

服务器搭建完成

客户机侧配置

linux主机配置

//编辑配置文件
vi /etc/profile
//在该配置文件的最后添加代理配置

# 代理服务器ip地址和端口号
export http_proxy='http://ip:port'  
export https_proxy='http://ip:port' 

// 退出profile文件并保存
source /etc/profile // 使配置文件生效

普通PC电脑

直接在浏览器或网络代理处配置