NOTE: Creating yum repository manually is not advisable if you are using Red hat. If so then you should switch to CentOS as it is a testing platform for red hat and you can get most of the RHEL features free of cost.
# mkdir /var/www/html/yum
# cp /dev/media/RHEL.x.x/Server/Packages/* /var/www/html/yum/
# mkdir /var/www/html/yum
# cp /dev/media/RHEL.x.x/Packages/* /var/www/html/yum/
# rpm -ivh /var/www/html/yum/createrepo-x.x.rpm
# createrepo /var/www/html/yum/
# vi /etc/yum.conf
[Server]
name=yum
baseurl=file:///var/www/html/yum
gpgcheck=0
enabled=1
# yum clean all
# yum update
# yum -y install httpd
Make the changes in hostname as per your machine
# vi /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
ServerAdmin root@server.deepsoft.com
ServerName server.deepsoft.com
DocumentRoot /var/www/html/yum/
<Directory /var/www/html/yum/>
Options Indexes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<Directory /var/www/html/yum/>
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
Go to the browser and type
If you want to use the same yum repository on any other machine then specify the url of the browser in yum.conf file of that machine in the following way
# vi /etc/yum.conf
[Server]
name=yum
baseurl=http://192.168.0.100/yum
gpgcheck=0
enabled=1
I hope the article was useful.