RedHatLinux7 build yum source server

Source: Internet
Author: User
RedHatLinux7 build yum source server 1. create a directory # mkdir-p/content/rhel7.1/x86_64/{isos, dvd}/2. upload the RedHat installation CD image, the uploaded path is/content/rhel7.1/x86_64/isos/rhel-server-7.1-x86_64-dvd.iso3. set the disk image to/content/rhel7.1/

RedHat Linux 7 yum source server

1. Create a directory

# Mkdir-p/content/rhel7.1/x86_64/{isos, dvd }/

2. Upload the RedHat installation CD image, the uploaded path is/content/rhel7.1/x86_64/isos/rhel-server-7.1-x86_64-dvd.iso

3. Set the disk image to/content/rhel7.1/x86_64/dvd

# Echo "/content/rhel7.1/x86_64/isos/rhel-server-7.1-x86_64-dvd.iso/content/rhel7.1/x86_64/dvd iso9660 loop, ro 0 0">/etc/fstab

# Mount-

4. Set up an http server (nginx) for network access to this yum Source

# Rpm-ivh http://nginx.org/packages/CentOS/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

# Yum-y install nginx

5. Create a yum source site (http://content.example.com) Profile

# Vi/etc/nginx/conf. d/content.example.com. conf

Server {
Listen 80;
Server_name content.example.com;

Access_log/var/log/nginx/content.example.com. access. log combined;

Location /{
Root/content;
Index index.html index.htm;
Autoindex on;
Autoindex_exact_size off;
Autoindex_localtime on;
}

# Error_page 404/404 .html;

# Redirect server error pages to the static page/50x.html
#
Error_page 500 502 503 x.html;
Location =/50x.html {
Root/usr/share/nginx/html;
}
}

6. Add DNS records to the/etc/hosts file

# Echo "192.168.136.254 content.example.com">/etc/hosts

7. Enable Firewall

# Firewall-cmd -- permanent -- add-service http

# Firewall-cmd -- reload

8. Modify the SELinux type of the website directory

# Chcon-t public_content_t-R/content/

9. Set the nginx service to start automatically and start the nginx service.

# Systemctl enable nginx

# Systemctl start nginx

10. Create a repo File

# Vi/etc/yum. repos. d/rhel-dvd.repo

[Rhel-dvd]
Name = remote ipa copy of dvd
Base url = http://content.example.com/rhel7.1/x86_64/dvd
Gpgcheck = 0
Enabled = 1

11. Generate a repo cache to test whether the new yum source takes effect.

# Yum makecache

For more YUM tutorials, see the following content::

RedHat 6.2 Linux modify yum source free use CentOS source http://www.linuxidc.com/Linux/2013-07/87383.htm

Configure epel yum source http://www.linuxidc.com/Linux/2012-10/71850.htm

Redhat local yum source configuration http://www.linuxidc.com/Linux/2012-11/75127.htm

Yum profile description http://www.linuxidc.com/Linux/2013-04/83298.htm

Install yum http://www.linuxidc.com/Linux/2013-06/86535.htm in RedHat 6.1

YUM installation and cleaning http://www.linuxidc.com/Linux/2013-07/87163.htm

Build yum local ground source http://www.linuxidc.com/Linux/2014-07/104533.htm on CentOS 6.4

For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-12/125905.htm

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.