[Linux] 无法访问国外网站,完成epel源安装的解决办法--待续
一、缘由:
由于一个机房的网络限制,无法访问国外IP地址,在安装一些开源软件的时候比如smokeping、ansible就无法从epel源在线安装,
编译安装的话,又需要安装各种依赖,麻烦的一逼。所以就想各种方法,完成在线安装吧,又不是不能上网。
二、解决办法:
1、用阿里云的epel源
受制于见识有限,以前只知道阿里云有Base.Repo。今天在阿里云ECS yum装Nginx,就用yum repolist查看了ECS自带的仓库,
发现其中有epel源,并由10000多个软件,如下所示:
Loaded plugins: security repo id repo name status base CentOS-6 - Base 6,696 epel Extra Packages for Enterprise Linux 6 - x86_64 12,200 extras CentOS-6 - Extras 62 updates CentOS-6 - Updates 706 repolist: 19,664
阿里云EPEL地址:http://mirrors.aliyun.com/epel/ 具体epel.repo文件见文章末尾。
2、用YUM代理访问(有一些报错,暂时还未解决)
A 机器192.168.100.1 可以访问国外IP
B 机器192.168.100.2 不能访问国外IP
1)A机器上用Nginx开代理服务
在nginx配置目录下新增 yum_proxy.conf
server { resolver 8.8.8.8; listen 10010; location / { proxy_pass http://$http_host$request_uri; access_log off; } }
并重新加载nginx -s reload
2)在B机器上配置yum代理
在/etc/yum.conf中新增一行
proxy=http://192.168.100.1:10010
3)执行yum 安装操作
有报错,待解决,待续
三、附录:
1、阿里云epel.repo
[epel] name=Extra Packages for Enterprise Linux 6 - $basearch baseurl=http://mirrors.aliyun.com/epel/6/$basearch http://mirrors.aliyuncs.com/epel/6/$basearch failovermethod=priority enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 [epel-debuginfo] name=Extra Packages for Enterprise Linux 6 - $basearch - Debug baseurl=http://mirrors.aliyun.com/epel/6/$basearch/debug http://mirrors.aliyuncs.com/epel/6/$basearch/debug failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=0 [epel-source] name=Extra Packages for Enterprise Linux 6 - $basearch - Source baseurl=http://mirrors.aliyun.com/epel/6/SRPMS http://mirrors.aliyuncs.com/epel/6/SRPMS failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=0
2、YUM代理设置参考 :http://blog.csdn.net/fwj380891124/article/details/39642877