服务器连代理
工作中有些服务器只允许在内网工作,ping外网ping不通
所以需要用到外网时(如使用yum源等安装应用)会出现问题。
1.执行以下指令,让所有服务的http和https请求走所设代理。
export http_proxy="10.39.59.xx:xxxx"
export https_proxy="10.39.59.xx:xxxx"
2.取消
http和https的代理
unset http_proxy https_proxy
3.需要使用yum安装软件
配置yum的conf文件为:
cat /etc/yum.conf
[main]
proxy=http://10.39.59.xx:xxxx
注释:不带[main] 等head文件,会报错。