因为没找到yum源 yum install tinyproxy -y (已经装了epel源) 报:
No match for argument: tinyproxy
Error: Unable to find a match: tinyproxy
所以centos8只能自己编译 tinyproxy
https://github.com/tinyproxy/tinyproxy.github.io
cd /root
git clone git://github.com/tinyproxy/tinyproxy
cd tinyproxy
autoreconf -i
./configure
make
cd docs/web
make
配置
vi /root/tinyproxy/etc/tinyproxy.conf
#允许使用代理的机器ip
Allow 192.168.1.0/24
#使用端口
Port 8899
#用于访问代理的HTTP“基本身份验证”格式: BasicAuth 账号 密码
#使用就取消注释 BasicAuth user password
DisableViaHeader Yes
启动服务器代理tinyproxy方法
/root/tinyproxy/src/tinyproxy -c /root/tinyproxy/etc/tinyproxy.conf
杀掉之前进程重启方法
kill -9 $(ps aux | grep tinyproxy | grep -v grep | tr -s ' '| cut -d ' ' -f 2) && /root/tinyproxy/src/tinyproxy -c /root/tinyproxy/etc/tinyproxy.conf
or
ps aux | grep tinyproxy | grep -v grep | tr -s ' '| cut -d ' ' -f 2 | xargs kill -9 && /root/tinyproxy/src/tinyproxy -c /root/tinyproxy/etc/tinyproxy.conf
加入tinyproxy.service文件自启:
cd /etc/systemd/system/ &&touch tinyproxy.service
设置权限:
chmod 754 /etc/systemd/system/tinyproxy.service
vim /etc/systemd/system/tinyproxy.service
按INS键编辑 复制以下内容进去
[Unit]
Description=tinyproxy
[Service]
Type=forking
ExecStart=/root/tinyproxy/src/tinyproxy -c /root/tinyproxy/etc/tinyproxy.conf
ExecStop=kill -9 $(ps aux | grep tinyproxy | grep -v grep | tr -s ' '| cut -d ' ' -f 2)
Restart=always
RestartSec=5
PrivateTmp=true
[Install]
WantedBy=multi-user.target
按ESC 后shift+: 输入:wq
加载配置文件,添加开机自启动
systemctl daemon-reload
systemctl enable tinyproxy
启动服务重启测试
systemctl start tinyproxy.service
ps -ef|grep tinyproxy
systemctl status tinyproxy.service
systemctl stop tinyproxy.service
reboot
ps -ef|grep tinyproxy