1. Introduction

Why do you need the internal YUM source? It is possible that the server inside the business is disconnected from the outside, for some security reasons. What are the advantages of internal YUM source? First, fast speed; Second, the internal network is controllable, and problems on the external network do not affect the download and installation of Intranet packages.

Deployment of 2.

2.1 Creating the Yum Repository Directory

mkdir -p /data/yum_data/centos/6/os/x86_64/
mkdir -p /data/yum_data/centos/6/extras/x86_64/
mkdir -p /data/yum_data/centos/6/updates/x86_64/
mkdir -p /data/yum_data/epel/6/x86_64/Copy the code

2.2 Synchronizing public Network YUM Sources with mirrors

Yum upstream source must support the rsync protocol, otherwise can’t use rsync to synchronize CentOS official standard source: rsync://mirrors.ustc.edu.cn/centos/epel source: rsync://mirrors.ustc.edu.cn/epel/ synchronous command:

rsync -auvzP --bwlimit=1000 rsync://rsync.mirrors.ustc.edu.cn/centos/6/os/x86_64/ /data/yum_data/centos/6/os/x86_64/ rsync -auvzP --bwlimit=1000 rsync://rsync.mirrors.ustc.edu.cn/centos/6/extras/x86_64/ /data/yum_data/centos/6/extras/x86_64/ rsync -auvzP --bwlimit=1000 rsync://rsync.mirrors.ustc.edu.cn/centos/6/updates/x86_64/ / data/yum_data/centos / 6 / updates/x86_64 / # epel source rsync - auvzP --bwlimit=1000 --exclude=debug rsync://rsync.mirrors.ustc.edu.cn/epel/6/x86_64/ /data/yum_data/epel/6/x86_64/Copy the code

2.3 Providing YUM Services

To deploy Tengine, the server configuration is as follows:

#/usr/local/nginx/conf.d/iso.conf server { listen 80; server_name localhost; access_log logs/iso.log main; location / { autoindex on; root /data/yum_data/; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }}Copy the code

2.4 Client Configuration

D / /etc/yum.repos. D/centos-base. Repo

[base107] name = CentOS - $releasever - Base baseurl = http://192.168.31.107/centos/$releasever/os/$basearch/ gpgcheck = 1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #released updates [updates107] name=CentOS-$releasever - Updates Baseurl = http://192.168.31.107/centos/$releasever/updates/$basearch/ gpgcheck = 1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras107] Name = CentOS - $releasever - Extras baseurl = http://192.168.31.107/centos/$releasever/extras/$basearch/ gpgcheck = 1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6Copy the code

The/etc/yum. Repos. D/epel. Repo configuration:

[epel107] name = Extra Packages for Enterprise Linux 6 - $basearch baseurl = http://192.168.31.107/epel/6/$basearch failovermethod=priority gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6Copy the code

2.5 Using Client Commands

yum clean all
yum install telnet -yCopy the code

3. Reference documents

  • http://www.zyops.com/autodeploy-yum

Author blog Green leaf