如何在Debian 10上安装Squid代理
admin
2023-07-31 21:11:05
0

Squid-cacheSquid-cache在Debian 10 Buster上安装Squid Proxy

步骤1.在安装任何软件之前,通过apt在终端中运行以下命令来确保系统是最新的很重要:

sudo apt update
sudo apt upgrade

步骤2.在Debian 10上安装Squid Proxy。

squid软件包包含在Debian 10存储库的标准中。运行以下命令以在Debian系统上安装Squid:

sudo apt install squid

步骤3.配置Squid代理服务器。

现在转到位于的Squid代理服务器的主配置文件。/etc/squid/squid.conf

sudo nano /etc/squid/squid.conf

添加以下行:

sudo nano /etc/squid/squid.conf
# Recommended minimum configuration:
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid/squid_passwd
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users

acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl SSL_ports port 443
acl Safe_ports port 80            # http
acl Safe_ports port 21            # ftp
acl Safe_ports port 443           # https
acl Safe_ports port 1025-65535    # unregistered ports
acl Safe_ports port 280           # http-mgmt
acl Safe_ports port 488           # gss-http
acl Safe_ports port 591           # filemaker
acl Safe_ports port 777           # multiling http
acl SSL_ports port 9001           # webmin
acl CONNECT method CONNECT

http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_port 3128 # Squid normally listens to port 3128

forwarded_for off

request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access Proxy-Connection allow all
request_header_access User-Agent allow all
request_header_access Cookie allow all
request_header_access All deny all
visible_hostname yundongfang.com

每当您对配置文件进行更改时,都需要重新启动Squid服务以使更改生效:

sudo systemctl restart squid

步骤4.配置Squid身份验证。

现在,我们创建身份验证文件,Squid可使用该文件来验证用户身份验证:

$ htpasswd -b /etc/squid/squid_passwd username password

示例创建鱿鱼身份验证:

$ htpasswd -b -c /etc/squid/squid_passwd ranty ratna

对配置文件进行更改后,保存该文件并使用在终端提示符下输入的以下命令重新启动squid服务器服务以进行更改:

sudo systemctl restart squid

步骤5.配置防火墙。

UFW用户可以3128通过启用“ Squid”配置文件来打开端口:

sudo ufw allow \'Squid\'

步骤6.为Squid代理服务器配置客户端。

让我们对使用Firefox Web浏览器进行代理的简单测试。只需转到菜单>首选项>网络设置>设置。选中对所有协议使用此代理服务器。

感谢您使用本教程在Debian 10 Buster上安装最新版本的Squid Proxy。有关其他帮助或有用信息,我们建议您检查Squid官方网站。

相关内容

热门资讯

Windows 11 和 10... Windows 11/10 文件夹属性中缺少共享选项卡 – 已修复 1.检查共享选项卡是否可用 右键...
事件 ID 7034:如何通过... 点击进入:ChatGPT工具插件导航大全 服务控制管理器 (SCM) 负责管理系统上运行的服务的活动...
Radmin VPN Wind... Radmin VPN 是一款免费且用户友好的软件,旨在牢固地连接计算机以创建一个有凝聚力的虚拟专用网...
Hive OS LOLMine... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
如何修复 Steam 内容文件... Steam 内容文件锁定是当您的 Steam 文件无法自行更新时出现的错误。解决此问题的最有效方法之...
如何在电报Telegram中隐... 点击进入:ChatGPT工具插件导航大全 在Android上的电报中隐藏您的电话号码 您可以通过切换...
Hive OS 部署 PXE ... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
在 iCloud 上关闭“查找... 如果您是 Apple 的长期用户,您肯定会遇到过 Find My 应用程序,它本机安装在 iPhon...
farols1.1.501.0... faro ls 1.1.501.0(64bit)可以卸载,是一款无需连接外部PC机或笔记本计算机即可...
如何在Instagram上扫描... 如何在Instagram上扫描名称标签/ QR? 总而言之,您可以通过大约四种不同的方法来扫描这些I...