Centos7 下代理配置
对于提供服务的服务器来说,一般都配置在内网环境中,而在内网下公司处于安全的考虑,一般不开放外网的访问权限。这时如果想要访问外网,一般需要配置公司提供的代理服务器再进行使用。下面介绍几种配置代理的方法:
添加代理
方式一:在 /etc/environment 下进行配置
在 /etc/environment 添加代理服务的内容:
# 通过自己搭建账号密码的代理服务器
http_proxy="http://username:password@proxysrv:8080/"
https_proxy="https://username:password@proxysrv:8080/"
ftp_proxy="ftp://username:password@proxysrv:8080/"
no_proxy=".mylan.local,.domain1.com,host1,host2"
# 通过公司提供
export http_proxy=http://proxy.esl.cisco.com:80/
export https_proxy=https://proxy.esl.cisco.com:80/
ftp_proxy=https://proxy.esl.cisco.com:80/
export http_proxy
export https_proxy
export ftp_proxy
方式二: /etc/profile 下添加:
export http_proxy=http://proxy.esl.cisco.com:80/
export https_proxy=https://proxy.esl.cisco.com:80/
ftp_proxy=https://proxy.esl.cisco.com:80/
export http_proxy
export https_proxy
export ftp_proxy
方式三:使用函数,动态添加:
# /.bashrc
# Set Proxy
function setproxy() {
export {http,https,ftp}_proxy="http://PROXY_SERVER:PORT"
}
# Unset Proxy
function unsetproxy() {
unset {http,https,ftp}_proxy
}
在配置后使用
source命令对应
查询配置的代理
env | grep -i proxy
临时删除代理
unset http_proxy
unset https_proxy
unset ftp_proxy
Centos7 下代理配置的更多相关文章
- Centos7下安装配置Redsocks
Redsocks是一个开源的网络程序,代码依赖开源的libevent网络库.Redsocks允许你将所有TCP连接重定向到SOCKS或HTTPS代理,比如Shadowsocks(Centos7下安装配 ...
- CentOS7下BIND配置主从服务器和缓存服务器
系统环境:CentOS Linux release 7.4.1708 (Core) 3.10.0-693.el7.x86_64 软件版本:bind-chroot-9.9.4-51.el7_4.1.x ...
- centos7下 nginx配置upstream 不能直接代理到本机tomcat的解决
Nginx代理本地tomcat时404. upstream是直接配置server localhost:10000 的.单独访问tomcat是可以的. 查看/var/log/nginx/error.lo ...
- Centos7 下安装配置tomcat7
首先下载压缩包 wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.78/bin/apache-tomcat-7. ...
- centos7下安装配置jenkins+git+maven+jdk
环境 centos7 jdk1.8 maven3 git 在安装jenkins之前,先安装jdk1.8.maven.git 一. 安装jdk1.8 第一步:下载 jdk-8u131-linux-x64 ...
- Centos7下oracle配置(详细)
一.硬件配置 CentOS7@VMware® Workstation 15 Pro,分配资源:CPU:2颗,内存:4GB,硬盘空间:30GB 二.软件准备 linux.x64_11gR2_datab ...
- CentOS7下安装配置vncserver
之前试了xmanager,不过好像和在centos6有很大不同,居然没成功,然后找到了vncserver,试了下,成了 参考:http://blog.csdn.net/jiangliqing1234/ ...
- Linux centos7下安装配置redis及Redis desktop Manager工具连接注意事项
基本工具:VMware12.CentOS-7-x86_64-Everything-1611.iso.redis-desktop-manager-0.8.0.3841 废话不多说,首先,关于什么是Red ...
- Centos7下安装配置elasticsearch 6.3.1
1)下载 Elasticsearch 6.3.1 地址:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.1 ...
随机推荐
- 使用Idea当中的快捷键快速查看继承关系或其图表的两种方法
一.Idea当中有两种方法可以查看继承关系 在Idea当中选中一个类,然后按Ctrl+H,可以快速查看当前所选类的继承关系,如下图: 同样选中一个类,按CTRL+ALT+U,即可生成当前类的继承关 ...
- thinkphp5.0--auth权限
一般auth权限有四个表: think_admin:注册表, think_auth_group_access:用户组明细表(关联), think_auth_group:用户组表, think_arut ...
- python学习07列表
'''列表''''''列表:是可变的序列,也是一种可以存储各种数据类型的集合 用[]中括号表示列表的开始和结束:元素之间用,逗号隔开 '''l1=[] #空列表print(len(l1))l2=[&q ...
- CG-CTF(3)
CG-CTF https://cgctf.nuptsast.com/challenges#Web 续上~ 第十四题:GBK Injection 是一道注入题: 分析:题目提示了GBK,GBK是一种多字 ...
- [Windows]允许未签名的驱动
bcdedit.exe -set loadoptions ENABLE_INTEGRITY_CHECKS bcdedit.exe -set TESTSIGNING OFF https://social ...
- 如何高效使用vim
Vim 是一款文本编辑器,被称为编辑器之神,非常适合在shell 中编辑代码,熟练的使用Vim,可以让你高效的编写代码. Vim 是Vi 的增强版,所有的类Unix 系统,都自带这两个工具,这两个工具 ...
- centos 服务器上部署 xxl-job 通过 feign 访问 eureka 上注册的 service timeout
部署方式 1.使用 jar 包部署 出现的问题 1.通过 feign 调用其他服务,出现超时的问题,该问题不是 ribbon.hystrix 没有配置导致的超时,经过测试,即使配置了也没有作用,该方法 ...
- IDEA 之 Java项目复制
1.复制一个项目,并改名字 2.更改以下文件名字 3.将以下文件中的原有名字,替换成更改后的名字(例如MyWebapp07替换成MyWebapp08) 4.将out文件夹给删除 5.然后用IDEA ...
- web 之 tomcat 8.5 和9.0如何进入manager?
tomcat 8.5 和9.0如何进入manager? 第一步找到tomcat-user.xml文件 第二步添加如下代码 <role rolename="manager-gui&quo ...
- 数学--数论--Find Integer(勾股数定理)
Problem Description people in USSS love math very much, and there is a famous math problem give you ...