Set up http proxy on CentOS 6.4








  1. Set up system wide proxy: System -> Preferences -> Network Proxy
  2. Edit /etc/environment:
    sudo vi /etc/environment
    and add lines like below:
    http_proxy=http://192.168.20.10:3128
    https_proxy=https://192.168.20.10:3128
    ftp_proxy=ftp://192.168.20.10:3128
    rsync_proxy=http://192.168.20.10:3128
    no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
    HTTP_PROXY=http://192.168.20.10:3128
    HTTPS_PROXY=https://192.168.20.10:3128
    FTP_PROXY=ftp://192.168.20.10:3128
    RSYNC_PROXY=http://192.168.20.10:3128
    NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"
  3. Edit /etc/bashrc:
    sudo vi /etc/bashrc
    and append lines:
    export http_proxy=http://192.168.20.10:3128
    export https_proxy=https://192.168.20.10:3128
    export ftp_proxy=ftp://192.168.20.10:3128
    export rsync_proxy=http://192.168.20.10:3128
    export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
    export HTTP_PROXY=http://192.168.20.10:3128
    export HTTPS_PROXY=https://192.168.20.10:3128
    export FTP_PROXY=ftp://192.168.20.10:3128
    export RSYNC_PROXY=http://192.168.20.10:3128
    export NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"
  4. Set yum proxy: edit /etc/yum.conf
    sudo vi /etc/yum.conf
    and add line:
    proxy=http://192.168.20.10:3128
  5. Keep proxy settings through sudo:
    sudo visudo
    and add the following line:
    Defaults env_keep += "http_proxy https_proxy ftp_proxy no_proxy"

See also




No comments:

Post a Comment