CentOS builds local Yum source server

Source: Internet
Author: User
Tags yum repolist

Install the CentOS system, configure the network environment of the system

    • Configure static IP

Vi/etc/sysconfig/network-scripts/ifcfg-eth0

device=Eth0type=ethernetonboot=yesnm_controlled=Yesbootproto=  Staticipaddr=192.168. 126.5 NETMASK=255.255. 255.0 Gatway=192.168. 126.2

    • Configure DNS

Vi/etc/resolv.conf

192.168. 126.2

If it is a virtual machine, the gateway address is configured

    • Configure the Gateway

Vi/etc/sysconfig/network

networking=yeshostname=YumGATEWAY=192.168. 126.2

    • Restart Network Service

Service Network restart

Installing Nginx Service

    • Download Nginx

Yum Install Nginx

If the download fails or the source is not found, you can install it by updating the third-party source

    • Set to on Start

Chkconfig Nginx on

    • Update Nginx Configuration

Vi/etc/nginx/nginx.conf

Add the following content to the http{:

AutoIndex on; #开启nginx目录浏览功能autoindex_exact_size off; #文件大小从KB开始显示autoindex_localtime on; #显示文件修改时间为服务器本地时间
    • Access Nginx

http://192.168.126.5

Preparing Yun Source data

    • Get disc Content

mount/dev/cdrom/mnt/

    • Copy the disc file to the Nginx directory

Mkdir/usr/share/nginx/html/yum

cp–rf/mnt/*/usr/share/nginx/html/yum/

    • Access Nginx

Http://192.168.126.5/yum

Update Yum Source information

    • Client host new Yum source configuration file

Vi/etc/yum.repos.d/localserver.repo

= CentOS/ localserverbaseurl=http://192.168.126.5/yum/1= http://  192.168.126.5/yum/rpm-gpg-key-centos-61
    • And then set the other source as invalid

VI Centos-base.repo

Add Enabled=0

    • Check for Updates

Yum Check-update

Yum Repolist

CentOS builds local Yum source 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.