Z-Blog

Good Luck To You!

Centos全局代理

进入profile修改配置


su root

vi /etc/profile

在第一行加入以下内容


export proxy="http://IP:PORT"

export http_proxy=$proxy

export https_proxy=$proxy

export no_proxy="localhost, 127.0.0.1, ::1"



其中第一行的ip和端口号根据自己的代理服务器具体配置更改,保存退出后,source一下

source /etc/profile

此时已经可以上*网了,可以用wget测试一下

wget www.github.com

如果在当前目录下成功下载了一个index.html文件,则代理成功



如果要关闭代理,仅仅注释掉profile的代理内容是不行的,在文件内加入以下内容


unset http_proxy

unset https_proxy

unset no_proxy


并重新source一下


  • 评论列表

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.7.3

Copyright Your WebSite.Some Rights Reserved.