安装
# centos
sudo yum install tinyproxy
# ubuntu
sudo apt install tinyproxy
配置
vim /etc/tinyproxy/tinyproxy.conf
需要修改的是:
# 注释掉这一行
# Allow 127.0.0.1
# 修改端口号
Port 8787
# 只有TinyProxy1.10.0版本及以上,才支持认证
#BasicAuth 用户名1 密码1
#BasicAuth 用户名2 密码2
BasicAuth user 123456
Allow 是允许访问的主机IP,不写就是允许所有主机访问
Port 是代理访问端口号
启动/停止/查看状态/重启命令
systemctl start tinyproxy.service
systemctl stop tinyproxy.service
systemctl status tinyproxy.service
systemctl restart tinyproxy.service
或者 service tinyproxy {start|stop|status|restart|condrestart|try-restart|reload|force-reload}
service tinyproxy start
查看日志
cat /var/log/tinyproxy/tinyproxy.log
杀掉tinyproxy进程
ps -ef | grep tinyproxy | grep -v grep| awk '{print "kill -9 "$2}' | sh
参考:
https://blog.51cto.com/u_15278282/2931913
https://blog.csdn.net/qq_44216791/article/details/120886610