RedHat7 build yum source server and redhat7 build yum

Source: Internet
Author: User

RedHat7 build yum source server and redhat7 build yum

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 504  /50x.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 dvdbaseurl=http://content.example.com/rhel7.1/x86_64/dvdgpgcheck=0enabled=1

11.Generate a repo cacheTest whether the new yum source takes effect

# Yum makecache

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.