CentOS7安装和使用squid代理

首先开放squid的默认端口,方法如上

服务器

安装squid: yum install squid 

修改配置文件: vi /etc/squid/squid.conf 

客户端

修改yum代理: vim /etc/yum.conf 加入 proxy=http://ip:port/ 

修改wget代理: vim /etc/wgetrc  加入 http_proxy=http://ip:port/ 

                    https_proxy=https://ip:port/ 

                            ftp_proxy=http://ip:port/ 

修改环境变量: vim /etc/profile  加入 export http_proxy=http://ip:port/ 

                     export ftp_proxy=http://ip:port 

              备注:环境变量的代理配置会影响Kubernetes组件之间的通信。如果想使用Kubernetes,应取消环境变量的相关设置。

修改git代理: git config --global http.proxy http://ip:port ​ 

        git config --global https.proxy https://ip:port 

取消命令: git config --global --unset http.proxy  

         git config --global --unset https.proxy 

posted @ 2019-03-04 08:33  哈提  阅读(664)  评论(0编辑  收藏  举报