Monday, February 16, 2009

Setting up a Linux Practice Lab (Part 3)

4. Creating the Yum Repository
Install the yum repository builder.
# cd /repo/Server
# rpm –ivh createrepo-*.rpm

Create the repository.
# cd /repo
# createrepo -g repodata/comps-rhel5-server-core.xml Server
# cp /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release Server

5. Setup web server to host the repository
Make sure you've installed the web server during installation, then proceed with these.
# cd /var/www/html
# ln –s /repo/Server server
# chkconfig httpd on
# service httpd start

Open the browser & browse to http://localhost/server to check that the web server is running (you should see the rpm files listed)

Now to setup yum to point to the new web repository
# cd /etc/yum.repos.d
# cp rhel-debuginfo.repo trainingserver.repo
# vi trainingserver.repo

Modify the file to look like this:
[trainingserver]
name=Red Hat Enterprise Linux Training Server
baseurl=http://192.168.1.100/server/
enabled=1
gpgcheck=1
gpgkey=http://192.168.1.100/server/RPM-GPG-KEY-redhat-release

Save the file. :wq
# yum update

Note: You can get the students to copy the yum setup to their systems with this command:
# scp root@192.168.1.100:/etc/yum.repos.d/trainingserver.repo /etc/yum.repos.d/

That's it for making your local yum repository. Next I'll talk about setting up the server for PXE boot installations.

No comments: