騰訊雲的YUM repo

用了半年多的騰訊雲和ucloud,發現他們都是和阿里雲同樣自建的軟件源php

http://centos.mirrors.cs.ucloud.cn/centos
http://mirrors.tencentyun.com/centoslinux

特別是軟件包很是全,並且也很穩定。nginx

之前要yum安裝nginx php-fpm等等還要下載源碼編譯,或者添加安裝epel yum源vim

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmcentos

用過的都知道,此源位於國外,國內訪問很慢。那咱們大能夠把yum源換成騰訊或者是ucloud的地址便可!服務器

但你有沒發覺上面的地址不能訪問呢?是的,咱們發現這域名指向了騰訊雲的內網。php-fpm

不要緊,在騰訊雲內經過nginx使用反向代理創建一個mirrors吧,nginx配置信息以下,其中mirrors.linux48.com改爲你本身的服務器地址。阿里雲

[root@VM_190_46_centos /etc/nginx/conf.d]# vim mirrors.linux48.com.conf 
server {
    listen 80;
    server_name mirrors.linux48.com;

    location / {
    proxy_pass    http://mirrors.tencentyun.com;
    proxy_redirect default;
        }
}

service nginx restart 便可訪問 http://mirrors.linux48.com/ 是否是很贊呢!url

附騰訊雲的epel.repocentos.repospa

[root@tx-dispatch ~]# vim /etc/yum.repos.d/epel.repo 
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://mirrors.tencentyun.com/centos/epel/$basearch/
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
~                                                                                                                                                                                                                                           

[root@VM_190_46_centos ~]# vim /etc/yum.repos.d/centos.repo 
[os]
name=Extra Packages for tlinux(Qcloud) - $basearch
baseurl=http://mirrors.tencentyun.com/centos/ustc/$releasever/os/$basearch/
enabled=1
gpgcheck=0

[updates]
name=Extra Packages for tlinux(Qcloud) - $basearch
baseurl=http://mirrors.tencentyun.com/centos/ustc/$releasever/updates/$basearch/
enabled=1
gpgcheck=0

[centosplus]
name=Extra Packages for tlinux(Qcloud) - $basearch
baseurl=http://mirrors.tencentyun.com/centos/ustc/$releasever/centosplus/$basearch/
enabled=1
gpgcheck=0

[contrib]
name=Extra Packages for tlinux(Qcloud) - $basearch
baseurl=http://mirrors.tencentyun.com/centos/ustc/$releasever/contrib/$basearch/
enabled=1
gpgcheck=0

[cr]
name=Extra Packages for tlinux(Qcloud) - $basearch
baseurl=http://mirrors.tencentyun.com/centos/ustc/$releasever/cr/$basearch/
enabled=1
gpgcheck=0

[extras]
name=Extra Packages for tlinux(Qcloud) - $basearch
baseurl=http://mirrors.tencentyun.com/centos/ustc/$releasever/extras/$basearch/
enabled=1
gpgcheck=0

[fasttrack]
name=Extra Packages for tlinux(Qcloud) - $basearch
baseurl=http://mirrors.tencentyun.com/centos/ustc/$releasever/fasttrack/$basearch/
enabled=1
gpgcheck=0

~                                                                                                                                                                                                                                           

[root@VM_190_46_centos ~]#
相關文章
相關標籤/搜索