搭建http代理+apt代理+wget代理+yum代理配置

部署tinyproxy

软件安装
    apt install tinyproxy

配置软件
cat > /etc/tinyproxy/tinyproxy.conf << EOF
User tinyproxy
Group tinyproxy
Port 65534
#Listen 192.168.0.1     监听端口
#Bind 192.168.0.1       流量出口
BindSame yes
Timeout 6000
DefaultErrorFile "/usr/share/tinyproxy/default.html"
StatFile "/usr/share/tinyproxy/stats.html"
LogFile "/var/log/tinyproxy/tinyproxy.log"
LogLevel Info
PidFile "/run/tinyproxy/tinyproxy.pid"
MaxClients 200
MinSpareServers 5
MaxSpareServers 20
StartServers 10
MaxRequestsPerChild 0
Allow 0.0.0.0/0
ViaProxyName "tinyproxy"
ConnectPort 443
ConnectPort 563
EOF

重启tinyproxy服务
    systemctl stop firewalld
    systemctl restart tinyproxy
    systemctl enable tinyproxy

日志查看
    tailf /var/log/tinyproxy/tinyproxy.log

Linux 设置wget代理

直接修改/etc/wgetrc   或者直接往~/.wgetrc(自行创建此文件)添加如下内容:

https_proxy = http://xxxx:65534/
http_proxy = http://xxxx:65534/
use_proxy = on

注意:如果不想使用代理了就将~/.wgetrc中的最后一行use_proxy = on改为 use_proxy = off即可.

Linux 设置apt代理

为apt配置http和https代理,(/etc/apt/apt.conf.d/10proxy默认没有,需要创建)
cat > /etc/apt/apt.conf.d/10proxy << EOF
Acquire::http::Proxy "http://xxxx:65534";
Acquire::https::Proxy "http://xxxx:65534/";
EOF

直接使用即可
    apt update

Linux 设置yum代理

    echo "proxy=http://xxxx:65534" >> /etc/yum.conf

Linux 直接全局将http https都设置为代理(不想用了只有重启才行了)

cat >> /etc/profile << EOF
export http_proxy=http://xxxx:65534
export https_proxy=http://xxxx:65534
EOF

source /etc/profile

curl 测试代理是否生效

    curl -x xxxx:65534 baidu.com        #前面是代理服务ip及监听端口
声明:本文为原创,作者为 辣条①号,转载时请保留本声明及附带文章链接:https://boke.wsfnk.com/archives/996.html
谢谢你请我吃辣条谢谢你请我吃辣条

如果文章对你有帮助,欢迎点击上方按钮打赏作者

最后编辑于:2023/2/26作者: 辣条①号

现在在做什么? 接下来打算做什么? 你的目标什么? 期限还有多少? 进度如何? 不负遇见,不谈亏欠!

暂无评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

arrow grin ! ? cool roll eek evil razz mrgreen smile oops lol mad twisted wink idea cry shock neutral sad ???

文章目录