PureftpdIt is a fast, high-quality, and fully functional ftp server. The most important thing is that it supports setting the Default Client encoding. Today I will give you a detailed introduction: the specific process of setting up FTP servers in Pureftpd and mysql.
Download the mysql5.1. 31 RPM file and the pure-ftpd source package
Install the mysql5.1.31 shared package
Rpm-ivh MySQL-shared-community-5.1.31-0.rhel5.i386.rpm
Compile and install pure-ftpd
- #./configure –prefix=/usr/local/pureftpd –with-mysql –with-paranoidmsg –with-welcomemsg –with-uploadscript –with-cookie –with-virtualchroot –with-virtualhosts –with-virtualroot –with-diraliases –with-quotas –with-sysquotas –with-ratios –with-ftpwho –with-throttling
-
- #make
-
- #make check
-
- #make install
Configure pure-ftpd
- #cd configuration-file
-
- #chmod u+x pure-config.pl
-
- #cp pure-config.pl /usr/local/sbin/
-
- #cp pure-ftpd.conf /usr/local/etc/
-
- vi /usr/local/etc/pure-ftpd.conf
Confirm the following three items
ChrootEveryone yes
MySQLConfigFile/etc/pureftpd-mysql.conf
CreateHomeDir yes
Create mysql Databases and users for puer-ftpd
Create database pureftpd;
Grant select, INSERT, UPDATE, DELETE, CREATE, drop on pureftpd. * TO 'pureftpd '@ 'localhost' identified by 'Password ';
Flush privileges;
USE pureftpd;
Create table ftpd (
User varchar (16) not null default ",
Status enum ('0', '1') not null default '0 ′,
Password varchar (64) not null default ",
Uid varchar (11) not null default '-1 ′,
Gid varchar (11) not null default '-1 ′,
Dir varchar (128) not null default ",
ULBandwidth smallint (5) not null default '0 ′,
DLBandwidth smallint (5) not null default '0 ′,
Comment tinytext not null,
Ipaccess varchar (15) not null default '*',
QuotaSize smallint (5) not null default '0 ′,
QuotaFiles int (11) not null default 0,
Primary key (User ),
Unique key User (User)
) TYPE = MyISAM;
Configure pureftpd-mysql.conf
Vi/etc/pureftpd-mysql.conf
Input
MYSQLSocket/tmp/mysql. sock
# MYSQLServer localhost
# MYSQLPort 3306
MYSQLUser pureftpd
MYSQLPassword password
MYSQLDatabase pureftpd
# MYSQLCrypt md5, cleartext, crypt () or password ()-md5 is very recommendable uppon cleartext
MYSQLCrypt md5
MYSQLGetPW SELECT Password FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")
MYSQLGetUID SELECT Uid FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")
MYSQLGetGID SELECT Gid FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")
MYSQLGetDir SELECT Dir FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")
MySQLGetBandwidthUL SELECT ULBandwidth FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")
MySQLGetBandwidthDL SELECT DLBandwidth FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")
MySQLGetQTASZ SELECT QuotaSize FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")
MySQLGetQTAFS SELECT QuotaFiles FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")