- 论坛徽章:
- 0
|
不用mod_sql没问题
不用mod_sql没问题
只要不加载数据库模块,就正常,包括本地用户也正常
不加载mod_模块配置如下
- # This is a basic ProFTPD configuration file (rename it to
- # 'proftpd.conf' for actual use. It establishes a single server
- # and a single anonymous login. It assumes that you have a user/group
- # "nobody" and "ftp" for normal operation and anon.
- ServerName "ProFTPD Default Installation"
- ServerType standalone
- DefaultServer on
- # 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
- # 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. Note 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 nogroup
- # To cause every FTP user to be "jailed" (chrooted) into their home
- # directory, uncomment this line.
- DefaultRoot ~
- # Normally, we want files to be overwriteable.
- AllowOverwrite on
- # Bar use of SITE CHMOD by default
- <Limit SITE_CHMOD>
- DenyAll
- </Limit>
- # A basic anonymous configuration, no upload directories. If you do not
- # want anonymous users, simply delete this entire <Anonymous> section.
- <Anonymous ~ftp>
- User ftp
- Group ftp
- # We want clients to be able to login with "anonymous" as well as "ftp"
- UserAlias anonymous ftp
- # Limit the maximum number of anonymous logins
- MaxClients 10
- # We want 'welcome.msg' displayed at login, and '.message' displayed
- # in each newly chdired directory.
- DisplayLogin welcome.msg
- DisplayFirstChdir .message
- # Limit WRITE everywhere in the anonymous chroot
- <Limit WRITE>
- DenyAll
- </Limit>
- </Anonymous>
复制代码
加载数据库模块后的配置如下
- # this is a basic ProFTPD configuration file (rename it to
- # 'proftpd.conf' for actual use. It establishes a single server
- # and a single anonymous login. It assumes that you have a user/group
- # "nobody" and "ftp" for normal operation and anon.
- ServerName &! quotublic FTP Server"
- ServerType standalone
- DefaultServer on
- # 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
- # 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. Note that this ONLY works
- # in standalone mode, in inetd mode you should use an inetd server
- # that allows you to&! nbsp;limit maximum number of processes per&nb sp;service
- # (such as xinetd)
- MaxInstances 200
- # 设置如果shell为空时允许用户登录
- RequireValidShell off
- # 用户登陆时不显示ftp服务器版本信息
- ServerIdent off
- # Set the user and group that the server normally runs at.
- User nobody
- Group nobody
- # Normally, we want files to be overwriteable.
- <Directory /*>
- AllowOverwrite on
- </Directory>
- #禁止匿名登陆
- # A basic anonymous configuration, no upload directories.
- #<Anonymous /home/ftp>
- #User ftp
- #Group ftp
- # We want clients to be able to login with "anonymous" as well as "ftp"
- #UserAlias anonymous ftp
- # Limit the maximum number of anonymous logins
- #MaxClients 10
- # We ! ;want 'welcome.msg' displayed at login, and '.message' displayed
- # in each newly chdired directory.
- #DisplayLogin welcome.msg
- #DisplayFirstChdir .message
- # Limit WRITE everywhere in the anonymous chroot
- #<Limit WRITE>
- #DenyAll
- #</Limit>
- #</Anonymous>
-
- <Global>
- AllowRetrieveRestart on
- AllowStoreRestart on
- MaxClients 20 "对不起,已达到当前客户端最大登陆数20人"
- MaxClientsPerHost 3 "您好!每个IP只允许3个进程同时登录!"
- AllowForeignAddress on
- </Global>
- UseReverseDNS off
- # 将用户限制在自己的主目录下
- DefaultRoot ~
- # 允许root登录
- RootLogin on
- #设置系统日志文件:
- SystemLog /var/log/proftpd/ftp.syslog
- #设置记录文件传输的日志文件:
- TransferLog /usr/log/proftpd/ftp.transferlog
- #设置断点继传
- AllowRetrieveRestart on
- #显示登录的信息
- DisplayLogin welcome.msg
- #限制用户速度
- TransferRate RETR 50 user test
- # 数据库联接的信息,proftpdb是数据库名,localhost是主机名,proftpd是连接数据库的用户名,
- #SQLConnectInfo ftpusers@MySQL服务器名 username password
- #proftpdb是密码
- #(如果没有密码留空)
- SQLConnectInfo proftpdb@localhost shuzhifeng 09250551
- # 数据库认证的类型
- SQLAuthTypes Backend Plaintext
- # 数据库的鉴别
- SQLAuthenticate users* groups*
- # 指定用来做用户认证的表的有关信息。
- SQLUserInfo ftpuser userid passwd uid gid homedir shell
- SQLGroupInfo ftpgroup groupname gid members
- # 如果home目录不存在,则系统会根据它的home项新建一个目录
- SQLHomedirOnDemand on
- #这是目录所有者,我觉得这个很重要。所以我用nobody来做,在此我的nobody为99.
- SQLDefaultGID 99
- SQLDefaultUID 99
- 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
- # 启用磁盘限额
- QuotaDirectoryTally on
- # 磁盘限额单位 b"|"Kb"|"Mb"|"Gb"
- QuotaDisplayUnits "Kb"
- #打开磁盘限额引擎
- QuotaEngine on
- # 磁盘限额日志记录
- QuotaLog "/var/log/quota.log"
- # 打开磁盘限额信息,当登陆FTP帐户后,使用命令 "quote SITE QUOTA" 后可显示当前用#户的磁盘限额
- QuotaShowQuotas on
- #以下为sql语句:
- SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail,bytes_out_avail, 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-limit
- QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally
复制代码
./proftpd -nd9
错误信息如下
- - ROOT PRIVS at mod_quotatab.c:1977
- localhost.localdomain (221.194.30.48[221.194.30.48]) - RELINQUISH PRIVS at mod_quotatab.c:1984
- localhost.localdomain - FS: using system lstat()
- localhost.localdomain - FS: using system lstat()
- localhost.localdomain (221.194.30.48[221.194.30.48]) - FTP session closed.
- localhost.localdomain - FS: using system lstat()
复制代码
proftp在运行 |
|