From jonathan@pickard-family.co.za Mon Sep 22 19:52:28 2003
Date: Mon, 22 Sep 2003 23:52:00 +0100 (BST)
From: jonathan pickard <jonathan@pickard-family.co.za>
To: Robert G. Brown <rgb@phy.duke.edu>
Subject: vsftp and yum

Hi
Here is the first txt file.
It is how to set up vsftp as the ftp server for yum. It could be a link in
section 5 attached to FTP as a hyperlink?

Damn squirrelMail is acting up so I have copied and pasted the text - is
this ok?

---------------------------------------------------------------------------
Local repository for YUM
To run YUM from a local server you will need either a webserver, an ftp
server or NFS server to be installed and running. A server is basically
required to serve up the YUM headers and the packages for installation.

If you have more than 1 machine on a local network that you want to use
YUM on then I suggest you create your own YUM repository. You could just
leave the yum.conf file unchanged and download the packages from a remote
server as required for all your machines or you could have the packages
stored locally for use when _you_ need them.

Having a local repository also allows you to have a large number of rpms
from different sources on your server that may not be available via YUM
from a remote repository. As an example you could hold all the
freshrpm.net rpms, fedora.us rpms, all the rawhide rpms and the base rpms
locally in your own repository.

FTP server
If you rsync or just download your packages from your local mirror to your
server then you could run an ftp server locally to make these packages
available to your network via YUM. The process is really simple and
painless.

There are many ftp servers available for Linux. Most ftp servers do the
same thing so the choice is really up to you. The ftp server that I like
to use is vsftp. The rpm is usually available from the installation discs
or can be downloaded from http://www.rpmfind.net. Vsftp is used by many
large companies as the ftp server of choice and is very secure, it's in
the name so it must be true.

Download the latest version of vsftp from your local mirror and save it to
/var/ftp/pub/yum on the server.

Installation
First check to see if vsftp is already installed on your machine, this is
easily done by using rpm -q vsftpd. The system will tell you if the server
is installed or not. If you get this 'package vsftpd is not installed'
then you will need to install the ftp server.

To install/upgrade the ftp server run

	cd /var/ftp/pub/yum
	rpm Uvh vsftpd-1.1.3-8.i386.rpm          #this is the rpm for RH9.


You can of course use rpm -ivh vsftpd-1.1.3-8.i386.rpm to install the
package I fthe pckage is not already installed. The flag -U is for upgrade
and -i is for install. No big deal they will both work, IMHO -U is just
better practise.

vsftpd.conf
After the package has been installed you will need to edit the vsftp.conf
file. This is usually found at /etc/vsftpd/vsftpd.conf. If it is not here
then just run

	rpm -ql vsftp

And look in the list where the .conf file is. To edit the .conf file you
can use kate, gedit, vi or any other text editor. You will need to be root
to change the file.

	vi /etc/vftp/vsftp.conf

This is the config file for the ftp server. If your network is secure and
behind a firewall then you can leave this option in the .conf file.

	# Allow anonymous FTP? (Beware - allowed by default if you comment this
out).
	anonymous_enable=YES

You can also change the welcome message of the ftp server

	# You may fully customise the login banner string:
	ftpd_banner=Welcome to YUM FTP service.


If you want security then set the flag anonymous_enable=NO. This will
force the user to log into the ftp server to get access to the packages.
It is prudent to make users log into the ftp server, but if this is your
private server then it may not be necessary.

Save the .conf file. You will need to restart the service to activate the
changes to the ftp server.

	service vsftpd restart

You should get this message

	Shutting down vsftpd:                         [  OK  ] or [ FAILED ]
	Starting vsftpd for vsftpd:                   [  OK  ]

It is also prudent to run

	chkconfig vsftpd on
	chkconfig --list vsftpd

You should get a message that looks like this

	vsftpd         0:off   1:off   2:on    3:on    4:on    5:on    6:off

Your ftp server will now start everytime you start Linux on this machine.
The ftp server is up and waiting for connections.

Testing
It is probably a good idea to test that the ftp server is working
correctly. This is easily done by logging onto the ftp server

	ftp 127.0.0.1
	Connected to 127.0.0.1 (127.0.0.1).
	220 Welcome to YUM FTP service.
	Name (127.0.0.1:root): anonymous
	331 Please specify the password.
	Password:
	230 Login successful.
	Remote system type is UNIX.
	Using binary mode to transfer files.
	ftp>

If you type ls you will see that you are in the pub directory. This is
/var/ftp/pub. This is important for when you rsync your packages to your
local machine.

That is it. The ftp server is running and waiting for connections.

----------------------------------------------------------------------------
