使用squid搭建HTTP代理

Linux·VPN·小知識 · 2024-03-25 · 284 人浏览
使用squid搭建HTTP代理

本次系統:Ubuntu

sudo apt-get update && sudo apt-get install -y squid
Bash

檢測是否開啓轉發

sysctl -a |grep -w ip_forward
Bash

2024-03-24T16:07:16.png

若爲0則找到/etc/sysctl.conf文件,修改爲以下内容
2024-03-24T16:10:02.png

修改 /etc/squid/squid.conf 配置文件 http_access deny allhttp_access allow all

grep -n 'http_access deny all' /etc/squid/squid.conf
Bash

/etc/squid/squid.conf文件 添加DNS解析

dns_nameservers 8.8.8.8 8.8.4.4
Bash

啓動

systemctl start squid
systemctl status squid
Bash

默認代理端口為3128

本站立足于美利堅合衆國,請讀者自覺遵守當地法律!如有違規,本站不承擔任何法律責任! This site is based in the United States of America, readers are requested to abide by local laws! If there are any violations, this site does not bear any legal responsibility! Theme Jasmine by Kent Liao