#install the packages needed to provide the service
--Via http--
 vi /etc/yum.repos.d/server.repo
[server]
name= redhat
baseurl=http://inst.example.com/inst/
gpgcheck=1
gpgkey=http://inst.example.com/inst/RPM-GPG-KEY-CentOS-5
enabled=1
--via ftp--
vi /etc/yum.repos.d/server.repo
[server]
name= redhat
baseurl=ftp://192.168.1.1/pub
gpgcheck=1
gpgkey=http://192.168.1.1/pub/RPM-GPG-KEY-CentOS-5
enabled=1
the root ftp users is checked in /etc/passwd 
/var/ftp
the share folder default is : /var/ftp/pub
--nfs--
vi /etc/exports
/var/ftp/pub   *(ro,sync)
exportfs -r
vi /etc/yum.repo/server.repo
[server]
name=redhat 5.
baseurl=ftp://192.168.1.1/pub
baseurl=file:///var/ftp/pub
remote nfs server need to use ftp and http protocol to connect
local nfs no need .jsut use protocol file://
#create yum redhat yum under http
mount /dev/cdrom /mnt
cd /mnt
cp -rf * /var/www/html/inst
cd /var/www/html/inst/Server
rpm -ivh createrepo-0.4*
createrepo -g /var/www/html/inst/Server/repodata/comp-* /var/www/html/inst/Server
createrepo -g /var/www/html/inst/VT/repodata/comp-* /var/www/html/inst/VT
createrepo -g /var/www/html/inst/Cluster/repodata/comp-* /var/www/html/inst/Cluster
createrepo -g /var/www/html/inst/ClusterStorage/repodata/comp-* /var/www/html/inst/ClusterStorage
rmdir .olddata

vi /etc/yum.repo/re.repo

#gpgcheck=0 can help to install RH version to CenTos

#yum makecache after vi /etc/yum.repo/server.repo

#if gpg error, ensure
rpm --import /etc/kpi/RPM-GPG-KEY-redhat-release