参考《使用163开源镜像升级你的Centos 》
如果设置源服务器为163的,你有很多服务器需要处理,那建立一个本地缓存服务器是一个很好的选择,更新一次后,那之后的更新速度可就快的要命啊。。
配置nginx为类似如下样子,自行修改自己的需求:
yum的配置可以如下:
就这样OK了!
原创内容如转载请注明:来自 阿权的书房
如果设置源服务器为163的,你有很多服务器需要处理,那建立一个本地缓存服务器是一个很好的选择,更新一次后,那之后的更新速度可就快的要命啊。。
配置nginx为类似如下样子,自行修改自己的需求:
upstream backend {
server mirrors.163.com:80 ;
}
server {
#server_name www.aslibra.com;
server_name mirrors.aslibra.com;
set $index 'index.htm';
set $store_file $request_filename;
#root /Data/www.aslibra.com;
root /Data/mirrors/mirrors.163.com;
if ($uri ~ /$ ){
set $store_file $request_filename$index;
}
location /centos/ {
index index.htm;
proxy_store on;
proxy_temp_path /Data/mirrors/tmp;
proxy_set_header Host mirrors.163.com;
proxy_store_access user:rw group:rw all:rw;
if ( !-e $store_file ) {
proxy_pass http://backend;
}
}
}
server mirrors.163.com:80 ;
}
server {
#server_name www.aslibra.com;
server_name mirrors.aslibra.com;
set $index 'index.htm';
set $store_file $request_filename;
#root /Data/www.aslibra.com;
root /Data/mirrors/mirrors.163.com;
if ($uri ~ /$ ){
set $store_file $request_filename$index;
}
location /centos/ {
index index.htm;
proxy_store on;
proxy_temp_path /Data/mirrors/tmp;
proxy_set_header Host mirrors.163.com;
proxy_store_access user:rw group:rw all:rw;
if ( !-e $store_file ) {
proxy_pass http://backend;
}
}
}
yum的配置可以如下:
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.aslibra.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.aslibra.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[addons]
name=CentOS-$releasever - Addons
baseurl=http://mirrors.aslibra.com/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.aslibra.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.aslibra.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
name=CentOS-$releasever - Base
baseurl=http://mirrors.aslibra.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.aslibra.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[addons]
name=CentOS-$releasever - Addons
baseurl=http://mirrors.aslibra.com/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.aslibra.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.aslibra.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
就这样OK了!
原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘
是init还是shutdown?
rhel服务器安装centOS的yum源
