- Install minimal RHEL installation
- Dedicate one harddrive for the repository packages
- Disable SElinux for httpd (in /etc/selinux/targeted/booleans)
- Allow access to these two sites on the outgoing firewall:
92.122.186.196 content-xmlrpc.rhn.redhat.com
- Register the installation by running rhn_register and typing registration info
- Mount the repository harddrive into /opt/repository
- Download the repository for the first time:
yum install createrepo
reposync -p /opt/repository/ –repoid=rhel-x86_64-server-5 –l
createrepo /opt/repository
- Create script to update the repository: /usr/local/bin/update-repository.sh
reposync -p /opt/repository/ –repoid=rhel-x86_64-server-5 -l -n
createrepo /opt/repository/
echo "Update script ended at $(date)" >> /var/log/update-repository.log
- Make it executable: chmod +x /usr/local/bin/update-repository.sh
- Add it to crontab to run every day at 00:15: crontab -e
- Share the repository via http:
/etc/httpd/conf.d/repository.conf
<Directory “/var/www/html/repository”>
Options Indexes +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
- Set up /etc/yum.repos.d/repository.repo on all RHEL clients:
name=Red Hat Enterprise Linux $releasever – $basearch
baseurl=http://<URL of the local repository server>/repository
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat
- Disable RHN on all clients but the local repository: /etc/yum/pluginconf.d/rhnplugin.conf
enabled = 0
gpgcheck = 1[rhel-i386-server-5]
enabled = 0
No comments:
Post a Comment