nb.c


HighPerformanceAnonymousFTPServer



This project is part of nb.c-project

Nonblocking sockets library


High Performance Anonymous FTP Server (RFC0959).
It is designed to run without forks or threads and with low memory usage, so it's suitable for heavy network traffic with very many connections. Tested with FreeBSD, Linux.
It work fine with different GUI-based ftp-clients (FAR FTP-client, Total Commander, IExplorer, Konqueror(KDE browser), Opera etc).

Why you should use hpaftpd for your anonymous FTP server ?

The single-threaded philosophy makes it faster than most other FTP daemons and makes it very light on memory. Standard FTP servers fork a child process for each new incoming connection, and then one or more child processes for each directory listing that connection requests. Hpaftpd does not need to spawn any additional processes after initialization.

Standard FTP servers fork a /bin/ls process to do each directory listing. Hpaftpd has own fast /bin/ls-compatible directory listing mechanism built-in.

And so you can service more remote users at a time.


Current version is hpaftpd 1.05

Download hpaftpd 1.05

To do

To compile:

run make utility or

$cc hpaftpd.c minilib.c mlib.c nb.c -o hpaftpd

then login as 'root' and

#./hpaftpd [-pporton] [-uuser_name] [-droot_dir] [-ttimeout] [-mmax_users] [-iIP_ADDR] [-l] [-h] [-v]

where
-pporton - service port (default is 21)
-uuser_name - user name of 'anonymous'(anonymous by default)
-droot_dir - root directory
-ttimeout - connection timeout, secs (300 by default)
-mmax_users - maximum amount of users(connections)(500 by default)
-iIP_ADDR - listen interface IP_ADDR only (listen all interfaces by default)
-l - enable detailed log
-h - this help
-v - print version and exit

for example:

#./hpaftpd -ujohn -d/home/john -t600 -m50

Anonymous user is john, work(root) directory is /home/john, FTP port is 21,
connection timeout is 10 min, 50 users, serve all interfaces.

Important

Do not run this service from inetd, xinetd or others tcp-wrappers !


(c) /dev/www, 2006-2007