{"id":5443,"date":"2015-12-19T20:12:19","date_gmt":"2015-12-19T12:12:19","guid":{"rendered":"http:\/\/rmohan.com\/?p=5443"},"modified":"2015-12-19T20:12:19","modified_gmt":"2015-12-19T12:12:19","slug":"redhat-linux-7-build-yum-source-server","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5443","title":{"rendered":"RedHat Linux 7 build yum source server"},"content":{"rendered":"<p>RedHat Linux 7 build yum source server<\/p>\n<p>1. Create a new directory<\/p>\n<p>mkdir -p \/var\/www\/rhel7.1\/x86_64\/{isos,dvd}\/<\/p>\n<p>2. Upload RedHat installation CD image, path after uploading the<\/p>\n<p>\/var\/www\/rhel7.1\/x86_64\/isos\/rhel-server-7.1-x86_64-dvd.iso<\/p>\n<p>3. Set the boot automatically mount the CD image to \/var\/www\/rhel7.1\/x86_64\/dvd<br \/>\necho &#8220;\/var\/www\/rhel7.1\/x86_64\/isos\/rhel-server-7.1-x86_64-dvd.iso \/var\/www\/rhel7.1\/x86_64\/dvd iso9660 loop,ro 0 0&#8221; &gt;&gt; \/etc\/fstab<\/p>\n<p>mount -a<br \/>\n4. build http server (nginx), is used to access the network yum source<br \/>\nrpm -ivh http:\/\/nginx.org\/packages\/CentOS\/7\/noarch\/RPMS\/nginx-release-centos-7-0.el7.ngx.noarch.rpm<\/p>\n<p># yum -y install nginx<\/p>\n<p>5. Create yum source website (http:\/\/content.example.com) profile<\/p>\n<p>vi \/etc\/nginx\/conf.d\/repo.rmohan.com.conf<\/p>\n<p>server {<br \/>\nlisten 80;<br \/>\nserver_name repo.rmohan.com;<\/p>\n<p>access_log \/var\/log\/nginx\/repo.rmohan.com.access.log combined;<\/p>\n<p>location \/ {<br \/>\nroot \/content;<br \/>\nindex index.html index.htm;<br \/>\nautoindex on;<br \/>\nautoindex_exact_size off;<br \/>\nautoindex_localtime on;<br \/>\n}<\/p>\n<p>#error_page 404 \/404.html;<\/p>\n<p># redirect server error pages to the static page \/50x.html<br \/>\n#<br \/>\nerror_page 500 502 503 504 \/50x.html;<br \/>\nlocation = \/50x.html {<br \/>\nroot \/usr\/share\/nginx\/html;<br \/>\n}<br \/>\n}<\/p>\n<p>6. Add a DNS record to the \/etc\/hosts file<\/p>\n<p>echo &#8220;192.168.1.25 repo.rmohan.com&#8221; &gt;&gt; \/etc\/hosts<br \/>\n7. The opening of the firewall<\/p>\n<p># firewall-cmd &#8211;permanent &#8211;add-service http<\/p>\n<p># firewall-cmd &#8211;reload<\/p>\n<p>8. Modify SELinux type Web Directory<\/p>\n<p>chcon -t public_content_t -R \/content\/<\/p>\n<p>9. Set nginx service boot from the start, and start nginx service<\/p>\n<p># systemctl enable nginx<br \/>\n# systemctl start nginx<\/p>\n<p>10. Create a repo file<\/p>\n<p># Vi \/etc\/yum.repos.d\/rhel-dvd.repo<\/p>\n<p>[rhel-dvd]<br \/>\nname=remote ipa copy of dvd<br \/>\nbaseurl=http:\/\/repo.rmohan.com\/rhel7.1\/x86_64\/dvd<br \/>\ngpgcheck=0<br \/>\nenabled=1<\/p>\n<p>11. Generate repo cache, to test whether the entry into force of the new yum source<\/p>\n<p>#yum makecache<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RedHat Linux 7 build yum source server<\/p>\n<p>1. Create a new directory<\/p>\n<p>mkdir -p \/var\/www\/rhel7.1\/x86_64\/{isos,dvd}\/<\/p>\n<p>2. Upload RedHat installation CD image, path after uploading the<\/p>\n<p>\/var\/www\/rhel7.1\/x86_64\/isos\/rhel-server-7.1-x86_64-dvd.iso<\/p>\n<p>3. Set the boot automatically mount the CD image to \/var\/www\/rhel7.1\/x86_64\/dvd echo &#8220;\/var\/www\/rhel7.1\/x86_64\/isos\/rhel-server-7.1-x86_64-dvd.iso \/var\/www\/rhel7.1\/x86_64\/dvd iso9660 loop,ro 0 0&#8221; &gt;&gt; \/etc\/fstab<\/p>\n<p>mount -a 4. build http server (nginx), is used [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5443"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5443"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5443\/revisions"}],"predecessor-version":[{"id":5444,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5443\/revisions\/5444"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}