ProFTPd MySQL configuration tips

Setting up ProFTPd with MySQL isn’t “hard” per-se, but the most popular tutorial at Khoosys is kind of complex.http://www.khoosys.net/single.htm?ipg=848It has users, groups, quotas, and a lot of accounting.  So the tables are numerous and there are a lot of queries involved.

I ended up stripping out the groups and all the quota features, and went with the users and a little accounting.  I can’t share the details here, but, you basically turn features off by reading the sample config file, and then start deleting unneeded lines.  You can figure out which lines here:http://www.proftpd.org/docs/modules/mod_auth_pam.htmlMy configuration had PAM enabled, and it caused some problems.  So I disabled PAM, at least for now.  It needs to be reconfigured to work with the FTP accounts.http://www.castaglia.org/proftpd/modules/mod_sql.htmlDuring the configuration, it was difficult to debug.  The way to debug is to stop the server (via /usr/local/etc/rc.d/proftpd.sh stop), and then run the server at the console, with debugging.

system# proftpd -n -d 2

That will cause the server to start, but instead of going into the background, it will send error messages to the console. Start up the server, and connect to it via FTP. You’ll see it succeed, or fail with nice error messages. When you get an error, kill the process, fix the bug, and restart.Once the configuration is done, you can simply start the server the normal way (via /usr/local/etc/rc.d/proftpd.sh start).