Build a local area network CentOS Yum Server

Source: Internet
Author: User

Server-side configuration

1. Mount the disc image

Mkdir/mnt/cdrom

Mount/dev/sr0

2. Build Apache Server

Yum-y Install httpd

Service httpd Restart

Chkconfig httpd on

3. Copy disc image to www directory

Mkdir-p/var/www/html/yum/centos

cp-rp/mnt/cdrom/*/var/www/html/yum/centos

4. Installing Createrepo

Yum-y Install Createrepo

Createrepo/var/www/html/yum/centos

Client Configuration

Modify the Centos-base.repo file

vi/etc/yum.repos.d/ Centos-base.repo

The BaseURL with enabled 1 is set to server-side 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 is updated to and
# Geographically close to the client. You should the use of this for CentOS updates
# Unless you is manually picking other mirrors.
#
# If The mirrorlist= does not work for you, as a fall back to 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 could 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


This article is from the "System Operations" blog, please be sure to keep this source http://coolshell.blog.51cto.com/10748053/1698592

Build a local area network CentOS Yum Server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.