Web Server » Howto install Pure-ftpd with Database MySQL
Posted by HHH on 06/13/2009
Note: This guide is for server running WHM (Web Host Manager).
This guide has been tested and working fine on Fedora & Centos machines.
First login as root then run the following command in the Terminal:
Look at the current version of Pure-ftpd on your OS.
Then go to this site http://diff.cpanel.net/ftpinstall/pure-ftpd/src/ and download the corresponding version that you current have.
When finish downloading, run this command to rebuild your Pure-ftpd:
Remember to change pure-ftpd-1.0.21-9.tls.src.rpm to match the file you just downloaded in previous step.
Next run this command to install Pure-ftpd that we just rebuild:
Now edit file /etc/pure-ftpd.conf so it will load Pureftpd-mysql.conf file.
Uncomment this line:
Save and restart your Pure-ftpd
Next step is to edit your /etc/pureftpd-mysql.conf file. So it will authencate against your database table.
Here is my config setting sample.
Restart your Pure-ftpd Server and open up FTP client software and try to login with user account in your database, if no user exist then create 1.
This guide has been tested and working fine on Fedora & Centos machines.
First login as root then run the following command in the Terminal:
1.
/scripts/ftpup
Look at the current version of Pure-ftpd on your OS.
Then go to this site http://diff.cpanel.net/ftpinstall/pure-ftpd/src/ and download the corresponding version that you current have.
When finish downloading, run this command to rebuild your Pure-ftpd:
1.
rpmbuild --rebuild --define 'with_mysql 1' pure-ftpd-1.0.21-9.tls.src.rpm
Remember to change pure-ftpd-1.0.21-9.tls.src.rpm to match the file you just downloaded in previous step.
Next run this command to install Pure-ftpd that we just rebuild:
1.
rpm -Uvh /usr/src/redhat/RPMS/i386/pure-ftpd-1.0.21-9.tls.i386.rpm --force
Now edit file /etc/pure-ftpd.conf so it will load Pureftpd-mysql.conf file.
Uncomment this line:
1.
MySQLConfigFile /etc/pureftpd-mysql.conf
Save and restart your Pure-ftpd
1.
/etc/init.d/pure-ftpd restart
Next step is to edit your /etc/pureftpd-mysql.conf file. So it will authencate against your database table.
Here is my config setting sample.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
MYSQLServer localhost
#MYSQLPort 3306
MYSQLSocket /tmp/mysql.sock
MYSQLUser database_user
MYSQLPassword database_pass
MYSQLDatabase database_name
MYSQLCrypt MD5
MYSQLGetPW SELECT Password FROM ftp_users WHERE Username="L"
MYSQLGetDir SELECT UserDir FROM ftp_users WHERE Username="L"
MySQLGetBandwidthUL SELECT ULBandwidth FROM ftp_users WHERE Username="L"
MySQLGetBandwidthDL SELECT DLBandwidth FROM ftp_users WHERE Username="L"
MYSQLDefaultUID 1000
MYSQLDefaultGID 1000
Restart your Pure-ftpd Server and open up FTP client software and try to login with user account in your database, if no user exist then create 1.
1.
/etc/init.d/pure-ftpd restart
Advertisement









