RedHat Linux 7 yum source server

Source: Internet
Author: User

RedHat Linux 7 yum source server

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:

RedHat 6.2 modify yum source in Linux use CentOS source for free

Configure the epel yum Source

Redhat local yum source configuration

Description of yum configuration file

Install yum in RedHat 6.1)

YUM installation and cleaning

Build yum local source on CentOS 6.4

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.