生产机处于内网,无法直接访问外网,程序安装和漏洞修复等操作需要进行联网操作;通过在办公网(可访问外网)上设置代理服务器,生产机通过代理由办公网访问外网
系统:ubuntu
- tinyproxy安装与配置:
安装:
apt-get install tinyprox
配置:
vim /etc/tinyproxy/tinyproxy.conf
:
参数Port 8888
, 对外服务端口
参数Allow 127.0.0.1
,设置允许访问的ip,注释掉可以让任意ip访问服务启动:
service tinyproxy start
ϵͳ:linux
配置:
vim /etc/profile
,添加http
,https
代理设置
#添加Proxy代理信息(其中username和password根据需要填写,若无则不填写) http_proxy=http://ip:8888/ https_proxy=http://ip:8888/ export http_proxy export https_proxy
若设置了用户名和密码则,链接格式为http://username:password@ip:8888/
- 执行
source /etc/profile
- 重启系统
reboot
- 测试是否配置成功
curl www.baidu.com