搭建區域網路CentOS Yum伺服器

來源:互聯網
上載者:User

標籤:複製光碟片   address   光碟片鏡像   區域網路   伺服器   

服務端配置

1.掛載光碟片鏡像

mkdir /mnt/cdrom

mount /dev/sr0

2.搭建apache伺服器

yum -y install httpd

service httpd restart

chkconfig httpd on

3.複製光碟片鏡像到www目錄

mkdir -p /var/www/html/yum/CentOS

cp -Rp  /mnt/cdrom/*   /var/www/html/yum/CentOS

4.安裝createrepo

yum  -y  install  createrepo

createrepo  /var/www/html/yum/CentOS

 

用戶端配置

修改CentOS-Base.repo檔案

vi  /etc/yum.repos.d/ CentOS-Base.repo

enabled為1的baseurl都設定為服務端ip

baseurl= http://192.168.1.60/yum/CentOS

# CentOS-Base.repo 

# The mirror system uses the connecting IP address of the client and the 
# update status of each mirror to pick mirrors that are updated to and 
# geographically close to the client.  You should use this for CentOS updates 
# unless you are manually picking other mirrors. 

# If the mirrorlist= does not work for you, as a fall back you can try the  
# remarked out baseurl= line instead. 



[base] 
name=CentOS-$releasever - Base 
baseurl= http://192.168.1.60/yum/CentOS
gpgcheck=0 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 
enabled=1 

#released updates  
[updates] 
name=CentOS-$releasever - Updates 
baseurl= http://192.168.1.60/yum/CentOS
gpgcheck=0 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 
enabled=1 

#additional packages that may be useful 
[extras] 
name=CentOS-$releasever - Extras 
baseurl= http://192.168.1.60/yum/CentOS
gpgcheck=0 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 
enabled=1 

#additional packages that extend functionality of existing packages 
[centosplus] 
name=CentOS-$releasever - Plus 
baseurl= http://192.168.1.60/yum/CentOS
gpgcheck=0 
enabled=1 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 

#contrib - packages by Centos Users 
[contrib] 
name=CentOS-$releasever - Contrib 
mirrorlist= http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra 
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/ 
gpgcheck=1 
enabled=0 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 


本文出自 “系統營運” 部落格,請務必保留此出處http://coolshell.blog.51cto.com/10748053/1698592

搭建區域網路CentOS Yum伺服器

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.