前置

# 统一设置用户 
sudo adduser 用户名
sudo usermod -aG sudo 用户名

Squid

设置用户认证

auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwords
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated

sudo htpasswd -c /etc/squid3/passwords username_you_like
sudo tail -f  /var/log/squid/access.log

squid -z    #初始化缓存目录,squid新版本3.1可以省略

/etc/init.d/squid start    #启动squid服务

squid  -k check    #可以检测配置文件是否有错;可以简写为-kche

squid -k rec    #可以重新加载配置,reconfig的简写;

service squid restart    #重启squid服务;重启经常性的很慢,可以先killall squid,在启动服务;

netstat -ntpl      #查看端口是否打开:

TinyProxy

# TinyProxy
sudo apt install tinyproxy

#sudo apt update
#sudo apt install policykit-1

sudo vi /etc/tinyproxy/tinyproxy.conf

# 本地局域网IP
Allow 局域网ip
# squid IP
Allow Squid_ip

# 启动 TinyProxy
service tinyproxy start

# 停止 TinyProxy
service tinyproxy stop

# 重启 TinyProxy
service tinyproxy restart


sudo tail -f /var/log/tinyproxy/tinyproxy.log

Squid & TinyProxy

一级代理 Squid 默认端口

二级代理 TinyProxy

/etc/squid/peers.conf

从源码开始安装

How to setup a simple proxy server with tinyproxy (Debian 10 Buster) - NXNJZ

https://github.com/tinyproxy/tinyproxy/issues/199

sudo apt install -y git automake build-essential asciidoc xsltproc
git clone https://github.com/tinyproxy/tinyproxy

# Generate the GNU configure script:
cd tinyproxy
./autogen.sh
# Build and Install:
./configure
make
make install
cd ..
rm tinyproxy/ -r
最后修改:2021 年 11 月 16 日 10 : 40 AM