squid默認代理端口3128。vim
設置 -> 局域網設置 -> ip:port / username:passwdcentos
若是隻是暫時使用代理,在命令行輸入下面一條命令:bash
export http_proxy="http://210.45.72.XX:808"
另外: /root/.bashrc
中加入: export http_proxy="http://username:password@210.45.72.XX:808"
若是是經過ip或電腦的網卡地址認證,可忽略全部username 和 password .
注:中止使用代理的時候,要把改過的文件改爲原樣.尤爲是若是使用了exportui
注:中止使用代理的時候,要把改過的文件改爲原樣.
尤爲是若是使用了export http_proxy="http://210.45.72.XX:808"
命令,
要在命令行輸入:unset http_proxy ,
去除環境變量.
由於export http_proxy=」http://210.45.72.XX:808」這條命令的實質是把export後面的設置寫進環境設置文件中.spa
輸入env 能夠看全部的環境變量設置.
env >env.txt 能夠把環境變量輸出到env.txt中,而後打開看也能夠.
unset 變量 能夠取消曾經設過的環境變量..net
vim /etc/profile
http_proxy=http://username:password@yourproxy:8080/ ftp_proxy=http://username:password@yourproxy:8080/ export http_proxy export ftp_proxy
source /etc/profile
vim /etc/yum.conf
proxy=http://username:password@yourproxy:8080/
source /etc/profile
vim /etc/wgetrc
http_proxy=http://username:password@yourproxy:8080 https_proxy=http://username:password@yourproxy:8080 ftp_proxy=http://username:password@yourproxy:8080
source /etc/profile
在本身安裝的CentOS6.5中使用yum安裝軟件,老是提示404錯誤信息,百度後發現原來要設置yum源。 在安裝完CentOS後通常須要修改yum源,纔可以在安裝更新rpm包時得到比較理想的速度。國內比較快的有163源、sohu源。這裏以163源爲例子。 1. cd /etc/yum.repos.d 2. mv CentOS-Base.repo CentOS-Base.repo.backup 3. wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 4. mv CentOS6-Base-163.repo CentOS-Base.repo 5. yum clean all