Need to set up an FTP server on your network to simplify file transfer between users or hosts? Look no further than the robust, secure and very free proFTPD server, which has everything you need to get up and running in a jiffy. This article covers installing and configuring proFTPD for both regular and anonymous FTP, and also explains how to customize the operation of the server for different requirements.
By default, proFTPD logs all messages to the system logger, usually "/var/log/messages". You can alter the level of logging via the SystemLog directive,
# set system logging level
SyslogLevel debug
or even tell proFTPD to log all file transfers by means of the TransferLog
directive.
# set transfer log
TransferLog /var/log/xferlog
With this configuration, proFTPD logs all transfers to "/var/log/xferlog".
This data may then be read by an automated tool to calculate transfer statistics and bandwidth usage.
Here's a snippet of the system log,
May 7 17:03:58 olympus proftpd[7616]: olympus.melonfire.com
(localhost.localdomain[127.0.0.1]) - FTP session closed.
May 7 17:06:03 olympus proftpd[11531]: olympus.melonfire.com
(localhost.localdomain[127.0.0.1]) - FTP session opened.
May 7 17:06:10 olympus proftpd[11531]: olympus.melonfire.com
(localhost.localdomain[127.0.0.1]) - FTP session closed.
May 7 17:06:22 olympus proftpd[4096]: olympus.melonfire.com - received SIGHUP --
master server rehashing configuration file
May 7 17:06:24 olympus proftpd[11933]: olympus.melonfire.com
(localhost.localdomain[127.0.0.1]) - FTP session opened.
and here's
a snippet of the transfer log.
Wed May 7 11:20:00 2003 0 olympus.melonfire.com 9144 /home/joe/mbox b
_ o r joe ftp 1 * c
Wed May 7 11:20:19 2003 0 olympus.melonfire.com 0
/home/joe/outfile b _ i r joe ftp 1 * c
Wed May 7 12:42:11 2003 2 olympus.melonfire.com 8820072
/home/ftp/pub/winapps/acroread/ar500enu.exe b
_ o a a@a.com ftp 1 * c
Wed May 7 14:11:32 2003 0 olympus.melonfire.com 9144
/home/ftp/incoming/mbox b _ i a a ftp 1 * c
You can perform
so-called extended logging, in which all commands sent to the server are recorded to a file, with the ExtendedLog directive. This directive also allows you to specify the type of commands that are tracked - for example, use the keyword AUTH for authentication commands, RETR for file retrieval commands, or ALL for all commands (a complete list of supported keywords is available in the proFTPD documentation).
# set extended log
ExtendedLog /var/log/proftpdlog ALL
You can also set the server's debugging level with the DebugLevel directive, which must be followed by a number between 0 and 9 - this can come in handy if you experience problems with server startup or operation.
DebugLevel 9
Another way to obtain debugging output is to start the server with the
"-d" parameter, followed by a number between 0 and 9. Consider the following example, which demonstrates: