Create YUM Repository on FTP Server

Hi,

Finally got relief coz my YUM repository is now ready to be accessible by my clients! If u r a Linux administrator or geeks this article is not for u and its for newbies who wanted to know about it!
Thnak You!

Here am not gonaa explain what is YUM , what is REPOSITORY , and WHAT IS FTP Server

Here am gonna explain setting up FTP Server , setting up YUM Repository , accessing YUM Repository.

1) Setting up FTP Server

  • You need to have "vsftpd" demon started if not then u must install vsftpd rpm from your Red hat cd .
  • Navigate to /media/CDROM/Server
  • rpm -ivh vsftpd* ( Installs vsftpd demon)
  • Now you can see /var/ftp/pub directory if installation goes well.
  • You need to create YUM Repository on FTP so copy "Server" folder from ur CD or DVD to /var/ftp/pub
  • Now you need to create Repository or simply generate Required data or metadata which can be done using "createrepo" command but if u dont have it then jst install rpm from "Server" folder
  • rpm -ivh createrepo* (install createrepo)
  • Now everythin is installed.
  • Shoot up the command to generate repository : createrepo [FOLDER NAME]
  • ex. create Server (folder name where files are copied)
  • If u r still confused then jst go to folder which u recently copied and in that folder type above command.
  • Restart "vsftpd" demon : service vsftpd restart
  • Finished!
2) Common problem i faced while creating repository : i was not able to connect to my FTP Server and couldnt access files shared on FTP why ? ? ? ? ? reason was "iptables" ? ? ?

Originally, the most popular firewall/NAT package running on Linux was ipchains, but it had a number of shortcomings. To rectify this, the Netfilter organization decided to create a new product called iptables,

3) Just shutdown this "iptables" for now (for newbies) using following command

service iptables stop

4) Thats it . . .! now go to client machine and you can access your shared Files on server as :

ftp://server ip/directory

5) OK! Now we created this repo because our client want it to Update rpm from this Server!

6) Client Side configuration :
  • Go to /etc/yum.repos.d
  • Take a backup of file "rhel-debuginfo.repo" and copy same files with name "anything.repo"
  • Now fire up ur vi editor as : vi anything.repo
  • Structure of file :

  • [name of dir]
  • name = . . .
  • baseurl=ftp://ip/directory (your path)
  • enabled=1
  • gpgcheck=0
  • #gpgkey=. . .

And now you need to fireup some commands as follows :

1) service yum-updatesd restart
2) chkconfig yum-updatesd on
3) yum clean all


Now you try to install rpm you want and that will be installed right from FTP server!

Example : yum install "httpd*"

Finished!

Have a nice day!
Happy Linux!



0 comments:

Post a Comment