Linux系统下终端proxy代理配置

一、前言

1、工作中有时会遇到需要翻墙下载软件的问题,这个时候就用到了正向代理。

二、终端代理配置

2.1、代理变量的配置

2.2、变量的设置方法

a) 在 /etc/profile文件

b) 在 ~/.bashrc

c) 在 /etc/profile.d/文件夹下新建一个文件xxx.sh

写入如下配置:

export proxy="http://10.20.56.32:8000"export http_proxy=$proxyexport https_proxy=$proxyexport ftp_proxy=$proxyexport no_proxy="localhost, 127.0.0.1, ::1"

2.3、取消设置的方法

shell> unset http_proxyshell> unset https_proxyshell> unset ftp_proxyshell> unset no_proxy

三、延伸阅读

3.1、配置yum单独代理

shell> echo "proxy=http://10.20.57.32:8080/" >> /etc/yum.conf

3.2、php-fpm默认不加载系统的http/https proxy环境变量修改方法

# 添加php-ftpm关于env的如下配置,然后重启php-fpm服务。env[http_proxy] = "http_proxy=http://1.1.1.1:8082"env[https_proxy] = "https_proxy=http://1.1.1.1:8082"env[no_proxy] = "a.test.com,127.0.0.1,2.2.2.2"

3.3、subversion代理服务器配置

# 修改$HOME/.subversion/servers文件,在此文件的[global]段加上:http-proxy-host = 192.168.1.1http-proxy-port = 8080http-proxy-username = 91donkeyhttp-proxy-password = 123456

3.4、其他支持http/https正向代理的proxy软件

nginx

tinyproxy(简单,支持http/https协议)

squid(稳定简单,支持http/https协议)

3.5、squid 3.x正向代理proxy配置

shell> cat /etc/squid/squid.confhttp_access allow allhttp_port 8443cache deny all

原文:
https://www.cnblogs.com/91donkey/p/11640079.html

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2019年9月7日
下一篇 2019年9月7日

相关推荐