1、工作需要,有些不能连外网的机器,需要yum下载,maven下载,pip下载,npm下载,可以在内网中可以连外网的机器上建立http代理,上面软件可以通过代理下载。
2、代理服务器安装配置httpd
下载httpd:
dnf install httpd
修改配置文件:
vim /etc/httpd/conf/httpd.conf
主要改下面几行:(参考:mod_proxy - Apache HTTP Server Version 2.4)
查看服务、重启服务:
systemctl status httpd.service
systemctl restart httpd.service
3、使用代理
客户端配置http、https代理,在.bash_profile中(代理服务器IP:172.32.148.228,代理服务端口8070):
export http_proxy="http://172.32.148.228:8070"
export https_proxy="https://172.32.148.228:8070"
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$https_proxy
export no_proxy='127.0.0.1,172.32.148.228,172.32.155.57,172.32.155.58,172.32.155.59,localhost'
注意:代理服务器的防火墙可能限制端口
systemctl status firewalld
systemctl disable firewalld
systemctl stop firewalld