代码:
ServerName "Frank's FTP Server" ServerType standalone DefaultServer on
Port 21
Umask 022
MaxInstances 30
MaxLoginAttempts 3
User nobody
Group nobody
MaxHostsPerUser 1 "Sorry, you may not connect more than one time."
MaxClientsPerUser 2 "Only one such user at a time."
MaxClientsPerHost 3 "Sorry, you may not connect more than one time."
RootLogin off
RequireValidShell off
TimeoutStalled 10
MaxClients 10
AllowForeignAddress on
AllowStoreRestart on
ServerIdent off
DefaultRoot ~ ftpgroup
# databasename@host database_user user_password
SQLConnectInfo ftpdb@localhost proftpd password
SQLUserInfo ftpuser userid passwd uid gid homedir shell
SQLGroupInfo ftpgroup groupname gid members
SQLHomedirOnDemand on
#如果用户主目录不存在,则系统会根据此用户在用户数据表中的homedir字段的值新建一个目录
# Update count every time user logs in
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "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
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on
QuotaLog "/var/log/quota"
SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avai
l, 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_i
n_used, files_out_used, files_xfer_used FROM ftpquotatallies WHERE name = '%{0}' AND quota_type = '%{1}'"