How to build a pure-ftpd Debian package for OpenVZ virtual machines (without capabilities enabled)

The pure-ftpd package that comes with Debian 5.0 (Lenny) does not start in a OpenVZ virtual machine as it is compiled with "capabilities". This tutorial describes the steps to build a pure-ftpd Debian package with capabilities disabled:

Make a temporary directory

mkdir /usr/src/pure-ftpd
cd /usr/src/pure-ftpd

Download the source package for pure-ftpd

apt-get source pure-ftpd
apt-get build-dep pure-ftpd

Edit the rules file and add the switch "--without-capabilities"

cd pure-ftpd-1.0.21/debian
nano rules

Change the line:

optflags=--with-everything --with-largefile --with-pam --with-privsep --with-tls

to (one Line!):

optflags=--with-everything --with-largefile --with-pam --with-privsep --with-tls --without-capabilities

Build the Debian (.deb) package

cd ..
dpkg-buildpackage -uc -b

and install it

cd ..
dpkg -i pure-ftpd-common_1.0.21-11.4_all.deb pure-ftpd-mysql_1.0.21-11.4_i386.deb
/etc/init.d/pure-ftpd-mysql restart

To prevent that apt overwrites these manually compiled packages with the default packages from the Debian repositorys, execute these commands:

echo 'pure-ftpd-common hold' | dpkg --set-selections
echo 'pure-ftpd-mysql hold' | dpkg --set-selections

This tutorial is based on the german tutorial from planet_fox

pure-ftpd does not show more then 2000 files on Debian and Ubuntu

The pure-ftp daemon by default has a recursion limit of 2000 files, this prevents the server from showing more then 2000 files when you browse a directory with a FTP client. To expand this Limit to e.g 5000 files, create or edit the file /etc/pure-ftpd/conf/LimitRecursion and add a line "5000 500":

echo "5000 500" > /etc/pure-ftpd/conf/LimitRecursion

and then restart pureftpd:

/etc/init.d/pure-ftpd-mysql restart

How to speed up logins in pure-ftpd on Debian or Ubuntu Linux by disable name resolving

If you experience problems with slow logins in pure-ftpd, this is often caused by a problem with the resolving of the clients hsotname. This happens e.g. when you run a FTP server in your intranet and the hostname of the client computer does not exist in DNS. To disable name resolving in pureftpd, run the command:

echo 'yes' > /etc/pure-ftpd/conf/DontResolve

and then restart pure-ftpd

/etc/init.d/pure-ftpd-mysql restart

Disabling name resolving also fixes the following error message:

Jul 24 16:26:28 ispconfig pure-ftpd: (?@?) [ERROR] Sorry, invalid address given

How to enable verbose logging in pure-ftpd on Debian Linux

To turn on verbose logging (e.g. to debug FTP connection or authentication problems) inĀ  pure-ftpd FTP server on Debian and Ubuntu Linux, execute the following command as root user in the shell:

echo 'yes' > /etc/pure-ftpd/conf/VerboseLog

and then restart pure-ftpd, for init based systems:

/etc/init.d/pure-ftpd-mysql restart

For Servers that use systemd:

service pure-ftpd-mysql restart

The debug output will be logged to Syslog. To view the log content, execute:

tail -n 100 /var/log/syslog

To disable verbose logging, execute these commands:

rm -f /etc/pure-ftpd/conf/VerboseLog
/etc/init.d/pure-ftpd-mysql restart