One. Prepare work to do 1. The Apache PHP MySQL environment 2 has been debugged on your machine. Download ProftPd Wget FTP: //ftp.proftpd.org/distrib/source/proftpd-1.2.10.tar.bz2 Because you find 1.2.10 directly support SQL and Quota II. Install tar -jxvf proFTPD-1.2.10.tar.bz2 cd proFTPD *
Quote: ./ Configure --prefix = / usr / local / proFTPD / --With-modules = mod_sql: mod_sql_mysql: mod_quotatab: mod_quotatab_sql / --with-incrudes = / usr / local / mysql / include / mysql / --with -libraries = / usr / local / mysql / lib / mysql make && make install proftpd modify the configuration vim /usr/local/proftpd/etc/proftpd.conf would read: ServerName "mail2004.3322.org" ServerType standalone DefaultServer on # user login is not displayed when the ftp server version information ServerIdent off # Port 21 is the standard fTP port. Port 21 # Umask 022 is a good standard umask to prevent new dirs and files # from being group and world writable. Umask 022 MaxLoginAttempts 3 TimeoutLogin 120 TimeoutIdle 600 TimeoutNoTransfer 900 TimeoutStalled 3600 MaxClients 100 # set up each host concurrent connections MaxClientsPerHost 3 AllowOverwrite no AllowStoreRestart on UseReverseDNS off # settings allow users to log RequireValidShell off if the shell is empty # restrict the user in their own home directory DefaultRoot ~ # to prevent Dos Attacks, Set The Maximum Number of Child Processes # To 30. If You NEED TO Allow More Than 30 Concurrent Connections # at ONCE, SIMPLY Increase this value. N ote that this ONLY works # in standalone mode, in inetd mode you should use an inetd server # that allows you to limit maximum number of processes per service # (such as xinetd). MaxInstances 30 # Set the user and group under which the server Will Run. User Nobody Group Nobody # Normal, We Want Files To Be Overwriteable.
Anonymous user directory for / ftp
So I do with nobody, and I is nobody updatecount SQLNamedQuery updatecount UPDATE is 99. SQLDefaultGID 99 SQLDefaultUID 99 SQLLog PASS "count = count 1, accessed = now () WHERE userid = '% u'" ftpuser # Update modified everytime user uploads or deletes a file SQLLog STOR, DELE modified SQLNamedQuery modified UPDATE "modified = now () WHERE userid = '% u'" ftpuser # enable disk quotas QuotaDirectoryTally on # disk quota units b "|" Kb "|" Mb "| "GB" QuotadisplayUnits "KB" QuotaEngine On # disk limit log record quotalog "/var/log/quota.log" "Open disk limit information, after logging in to the FTP account, use the command" quote site quota "to display the current # household disk quota QuotaShowQuotas on following is sql statement: SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_ava il, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM ftpquotalimits WHERE name = '% {0}' AND quota_type = '% {1}' "SQLNamedQuery get-quota-tally SELECT" name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files _in_used, files_out_used, files_xfer_used FROM ftpquotatallies WHERE name = '% {0}' AND quota_type = '% {1}' "SQLNamedQuery update-quota-tally UPDATE" bytes_in_used = bytes_in_used % {0}, bytes_out_used = bytes_out_used % {1}, bytes_xfer_used = bytes_xfer_used % {2}, files_in_used = files_in_used % {3}, files_out_used = files_out_used % {4}, files_xfer_used = files_xfer_used % {5} WHERE name = '% {6}' AND quota_type = '% {7}' "ftpquotatallies SQLNamedQuery insert-quota-tally INSERT"% {0},% {1},% {2},% {3},% {4},% {5},% {6},% {7} "
FTPQUOTATALLIES QuotalimitTable SQL: / GET-quota-limited quotata-tallyTable SQL: / get-quota-tally / update-quota-tally / insert-quota-tally can be added with phpMyadmin in MySQL, my SQL is the following Create Table `ftpgroup` (`Groupname` Varchar (16) Not null default ',` gid` smallint (6) Not null default' 99 ', `Members` Varchar (16) Not null default', key` groupname` ) TYPE = MyISAM COMMENT = 'ProFTP group table'; INSERT INTO `ftpgroup` VALUES ( 'nobody', 99, 'nobody'); CREATE TABLE` ftpquotalimits` ( `name` varchar (30) default NULL,` quota_type` enum ('User', 'Group', 'Class',' All ') Not Null Default' User ', `Per_Session` Enum (' false ',' true ') Not null default' false ',` limit_type` enum (' soft ',' hard ') NOT NULL default' soft ', `bytes_in_avail` float NOT NULL default' 0 ',` bytes_out_avail` float NOT NULL default' 0 ', `bytes_xfer_avail` float NOT NULL default' 0 ',` files_in_avail` INT (10) unsigned not null default '0', `files_out_avail` int (10) unsigned not null default '0',` files_xfer_avail` int (10) unsigned not null Default '0') Type = Myisam; Create Table `ftpquotatallies` (` Name` VARCHAR (30) Not Null Default ', `quota_type` Enum (' user ',' group ',' class', 'all') Not Null Default 'User', `Bytes_in_used` Float Not Null Default '0',` Bytes_Out_used` Float Not Null Default '0', `Bytes_xfer_used`
float NOT NULL default '0', `files_in_used` int (10) unsigned NOT NULL default '0',` files_out_used` int (10) unsigned NOT NULL default '0', `files_xfer_used` int (10) unsigned NOT NULL default ' 0 ') Type = Myisam; Create Table `ftpuser` (` ID` int (10) unsigned not null auto_increment, `Userid` Varchar (32) Not null default',` passwd` VARCHAR (32) Not null default ' , `uid` smallint (6) Not null default '99',` Gid` Smallint (6) Not null default '99', `Homedir` Varchar (255) Not null default '',` shell` VARCHAR (16) Not` Null default '/ sbin / nologin', `count` int (11) Not null default '0',` Accessed` DateTime Not Null Default '0000-00-00 00:00:00', `modified` DateTime Not Null Default '0000-00-00 00:00:00', primary key (`ID`)) type = myisam comment = 'proftp user table'; launch proFTPD / usr / local / proFTPD / sbin / proFTPD Start in the data number Join the user in FTPUSER, you can password.