在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官方网站。
原创文章,作者:校长,如若转载,请注明出处:https://www.yundongfang.com/Yun39146.html