PureFTPd and ProFTPd with MySQL

SeLLeRoNe

Super Moderator
Joined
Oct 9, 2004
Messages
6,643
Location
A Coruña, Spain
Hi everyone,

im working on a DA Clustering system and is going pretty nice (almost everything done, just missing system user sync with same UID/GID).

I did face user issue for FTP accounts, so ive did search a bit for a solution and MySQL came to me in a way i didnt think...

PureFTPd and ProFTPd both are compatible with MySQL for password storage, so, if we implement this as a standard it will help sync FTP user between DA Clsutered Servers.

The Database should be called da_ftp or da_pureftpd/da_proftpd and just configuration files will need to be updated (also add the relative line on FTP Server compiling) as is already done with roundcube, so, all the user will be stored in a MySQL DB that can be easly saved and exported.

It would be very important if this is implemented in a standard DirectAdmin System for future implementations.

Is anyone else interested in this solution?
Does anyone have any idea for sync system user between multiple server mantaining those three files exactly the same? (passwd,shadow,group)

Best regards
 
Yes, thats a way... but a way better should be just use integrated function so with mysql replication you can have directly all server synced with no time wait on sync needed.

Also, for sync that accross server you need to share /etc/proftpd.passwd file and than run the command to sync .passwd file with pureftpd db file...

I still think mysql is the better solution for this.

Regards
 
I can't see the need to sync with MySQL, probably because I don't understand the details of what yu mean by clustering. Can you share your idea of how you'd spread usage across various servers?

Jeff
 
Hi Jeff,

i did setup 2 load balancer as front-end for 2 directadmin server with mysql replication active between them and a storage (nfs) server.

With this i was able to have a load balancer and failover for all domain hostend into directadmin.

Now im facing last two problems:

1 - all system users between da servers and storage must be synced with same uid/gid, so, passwd shadow and group file must be the same
2 - FTP Account are stored in a file into /etc

Ssince i dont wanna share that folder i did search for an alternative and it was use mysql that is already replicated on both server so, every new user added into mysql is directly avaible on both servers.

This is what im planning to do for be able to provide a Clustered infrastructure with failover and load balancing.

I hope i did made it clear enough :)

Best regards
 
You did :). Did you buy a commercial load balancer or write your own?

Jeff
 
No, i did use HAproxy which is open source ;) http://haproxy.1wt.eu/

Im studying about upload those files into a mysql db and let other system download if a id (which would be date/time) value is higher than local (probably just a txt file). I cant see any other way unless build up an LDAP server but will cause many changed in all systems, include directadmin, so, for now this seems to me the best way... at least for passwd/group/shadow files... for pureftpd/proftpd the integrated mysql solution would be the better choise.

Regards
 
I still think you should just write a shell script that keeps them in sync and grep out the users that you want. If you want them 100% identical of course you could always sync them with rsync or something. You could also look at http://www.drbd.org/
 
Actually yes, i did it using rsync and now is working pretty fine for all needed files.

Thanks for the suggestion chatwizrd, actually it did the trick without much pain.

Im working on the installation scripts now.

Regards
 
Back
Top