CentOS設(shè)置上網(wǎng)代理全過程
更新時間:2025年12月02日 14:33:06 作者:笑锝?jīng)]心沒肺
該文章詳細介紹了在CentOS 7.0系統(tǒng)上設(shè)置代理服務(wù)器的過程,包括設(shè)置全局代理、yum代理、wget代理以及配置Docker HTTP代理的步驟
這里以centos7.0為例,記錄代理服務(wù)器設(shè)置過程:
1、設(shè)置全局代理,需要編輯profile文件
vim /etc/profile #無用戶名密碼 export http_proxy=http://proxy_ip:prot export https_proxy=https://proxy_ip:prot #有用戶名密碼 export http_proxy=http://username:password@proxy_ip:prot export https_proxy=https://username:password@proxy_ip:port 生效配置文件 source /etc/profile
查看當(dāng)前已設(shè)置代理
echo $http_proxy echo $https_proxy
2、yum的代理設(shè)置
vi /etc/yum.conf 添加下面內(nèi)容 proxy = http://username:password@yourproxy:8080/ 或者 proxy=http://yourproxy:8080 proxy=ftp://yourproxy:8080 proxy_username=username proxy_password=password
3、Wget的代理設(shè)置
vi /etc/wgetrc 添加下面內(nèi)容 # Proxy http_proxy=http://username:password@proxy_ip:port/ ftp_proxy=http://username:password@proxy_ip:port/
4、配置docker http代理
mkdir -p /etc/systemd/system/docker.service.d vim /etc/systemd/system/docker.service.d/https-proxy.conf [Service] Environment="HTTP_PROXY=http://proxy.example.com:80/" "HTTPS_PROXY=https://proxy.example.com:443/" "NO_PROXY=localhost,127.0.0.1,docker-registry.example.com" 重啟docker服務(wù) systemctl daemon-reload systemctl restart docker systemctl show --property=Environment docker
總結(jié)
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
centos系統(tǒng)為php安裝memcached擴展步驟
這篇文章主要介紹了centos系統(tǒng)為php安裝memcached擴展的步驟,大家參考使用吧2014-01-01
Centos7系統(tǒng)下搭建.NET Core2.0+Nginx+Supervisor環(huán)境
本文為大家分享了如何在Centos7系統(tǒng)下搭建.NET Core2.0+Nginx+Supervisor環(huán)境,部署方法非常詳細2018-10-10
apache啟動報錯:the requested operation has failed解決辦法
apache啟動報錯:the requested operation has failed解決辦法2009-11-11
基于CentOS的Hadoop分布式環(huán)境的搭建開發(fā)
本篇文章介紹了基于CentOS的Hadoop分布式環(huán)境的搭建開發(fā),有興趣的可以了解一下。2016-11-11

