ProFTPD/MySQL

Introduction
To get an overall feeling on how to setup ProFTPD see ProFTPD You'll also need a user and a database in MySQL

Use flag
For MySQL support, you need to add the use flag

Configuration
We will separate the mysql configuration and main configuration:

And then we edit proftpd.conf and add:

Then we create appropriate tables: CREATE TABLE IF NOT EXISTS `ftpgroup` ( `groupname` varchar(16) COLLATE utf8_unicode_ci NOT NULL,  `gid` smallint(6) NOT NULL DEFAULT '5500',  `members` varchar(16) COLLATE utf8_unicode_ci NOT NULL,  KEY `groupname` (`groupname`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='ProFTP group table'; CREATE TABLE IF NOT EXISTS `ftpquotalimits` ( `name` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,  `quota_type` enum('user','group','class','all') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'user',  `per_session` enum('false','true') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'false',  `limit_type` enum('soft','hard') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'soft',  `bytes_in_avail` int(10) unsigned NOT NULL DEFAULT '0',  `bytes_out_avail` int(10) unsigned NOT NULL DEFAULT '0',  `bytes_xfer_avail` int(10) unsigned NOT NULL DEFAULT '0',  `files_in_avail` int(10) unsigned NOT NULL DEFAULT '0',  `files_out_avail` int(10) unsigned NOT NULL DEFAULT '0',  `files_xfer_avail` int(10) unsigned NOT NULL DEFAULT '0',  KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE IF NOT EXISTS `ftpquotatallies` ( `name` varchar(30) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',  `quota_type` enum('user','group','class','all') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'user',  `bytes_in_used` int(10) unsigned NOT NULL DEFAULT '0',  `bytes_out_used` int(10) unsigned NOT NULL DEFAULT '0',  `bytes_xfer_used` int(10) unsigned NOT NULL DEFAULT '0',  `files_in_used` int(10) unsigned NOT NULL DEFAULT '0',  `files_out_used` int(10) unsigned NOT NULL DEFAULT '0',  `files_xfer_used` int(10) unsigned NOT NULL DEFAULT '0',  KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE IF NOT EXISTS `ftpuser` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT,  `userid` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT ,  `passwd` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT ,  `uid` smallint(6) NOT NULL DEFAULT '5500',  `gid` smallint(6) NOT NULL DEFAULT '5500',  `homedir` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',  `shell` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT '/sbin/nologin',  `count` int(11) NOT NULL DEFAULT '0',  `accessed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',  `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',  PRIMARY KEY (`id`),  UNIQUE KEY `userid` (`userid`) ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='ProFTP user table';

Adding users
I'm adding users with PhpMyAdmin but you can use anything you wish. For the passwords variatey of schemas can be used, to generate them in bash you can use: for c in `openssl list-message-digest-commands`; do   /bin/echo "{$c}"`/bin/echo -n "password" | openssl dgst -binary -$c | openssl enc -base64` done

More useful resources
ProFTPD mini-HOWTO - SQL and mod_sql