How to rebuild ProFTPd with MySQL support

You can build it from source to support MySQL. The question is how would you populate the MySQL database?

Jeff
 
I'm interested in (only) logging to a mysql database.
So a web application can detect new incoming files from which the transfer is completed, like the proftpd xferlog.

I made some changes to /usr/local/directadmin/custombuild/configure/proftpd/configure.proftpd
added:
--with-modules=mod_ratio:mod_readme:mod_tls:mod_sql:mod_sql_mysql
--with-includes=/usr/local/include/mysql
--with-libraries=/usr/local/lib/mysql

After compiling "proftpd -l" outputs:
Compiled-in modules:
- mod_sql.c
- mod_sql_mysql.c
- etc...
So sql should be working?

Added to proftpd.conf:
SQLLogFile /var/log/proftpd/debug
SQLConnectInfo database@localhost user password
SQLLog RETR,STOR incoming
SQLNamedQuery incoming FREEFORM "INSERT INTO test(test) VALUES ('foo')"

Restarting proftpd outputs no errors.

Tested the query through phpmyadmin with the same user/password, is working well.
But after uploading some files the database remains empty. Also the sql debug log remains empty.
The proftpd xferlog shows the upload, something like:
Mon Jun 22 12:42:59 2009 0 x.x.x.x 14172 /usr/home/user/test.rtf b _ i r user ftp 0 * c

I'm using the right config file, also tested it with the -c option.

Anyone?
 
Last edited:
As i said, i'm running a web application (with ajax).
As soon as a file upload has been completed it should be visible within the application.

Ok, i can let the application scan the directory for new files, but...
As soon as the upload starts the file appears, but the application should only display completed files.
So i can scan the directory 5 minutes later again and compare the sizes.
If they are the same the file could be completed.
But this is not what i want cause there is some hurry displaying the files.

Proftpd is writing a row to the xferlog as soon as a file upload has been completed, so i thought this should be the place to start catching the uploads.
 
For the sake of argument, I'm going to presume that ProFTPd can be made to write to a MySQL log.

I'm not sure, but presuming it can ... this isn't really the right forum in which to ask the question. It won't affect your DirectAdmin system in any way. I'd recommend looking for it on a ProFTd forum.

Jeff
 
Back
Top