LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 652|回复: 0

proftpd+mysql+quota的问题

[复制链接]
发表于 2004-1-18 19:49:30 | 显示全部楼层 |阅读模式
装好后,客户端就是连不上.

  1. # cat ftp.syslog
  2. Jan 18 12:22:11 battle proftpd[396] battle (61.139.64.120[61.139.64.120]): FTP session closed.
  3. Jan 18 12:23:17 battle proftpd[401] battle: ProFTPD 1.2.8 (stable) (built Fri Jan 16 11:05:30 CST 2004) standalone mode STARTUP
  4. Jan 18 12:23:41 battle proftpd[402] battle (61.139.64.120[61.139.64.120]): FTP session closed.
  5. Jan 18 12:24:33 battle proftpd[406] battle (61.139.64.120[61.139.64.120]): FTP session closed.
  6. Jan 18 13:07:10 battle proftpd[424] battle (221.203.71.16[221.203.71.16]): FTP session closed.
  7. Jan 18 15:10:45 battle proftpd[469] battle (203.236.81.8[203.236.81.8]): FTP session closed.
复制代码


  1. [root@battle etc]# cat proftpd.conf
  2. # This is a basic ProFTPD configuration file (rename it to
  3. # 'proftpd.conf' for actual use.  It establishes a single server
  4. # and a single anonymous login.  It assumes that you have a user/group
  5. # "nobody" and "ftp" for normal operation and anon.

  6. ServerName                      "ProFTPD Default Installation"
  7. ServerType                      standalone
  8. DefaultServer                   on

  9. # Port 21 is the standard FTP port.
  10. Port                            21

  11. # Umask 022 is a good standard umask to prevent new dirs and files
  12. # from being group and world writable.
  13. Umask                           022

  14. # To prevent DoS attacks, set the maximum number of child processes
  15. # to 30.  If you need to allow more than 30 concurrent connections
  16. # at once, simply increase this value.  Note that this ONLY works
  17. # in standalone mode, in inetd mode you should use an inetd server
  18. # that allows you to limit maximum number of processes per service
  19. # (such as xinetd).
  20. MaxInstances                    30

  21. # Set the user and group under which the server will run.
  22. User                            FTPUSR
  23. Group                           FTPGRP

  24. # To cause every FTP user to be "jailed" (chrooted) into their home
  25. # directory, uncomment this line.
  26. DefaultRoot ~

  27. #put the proftpd log files in /var/log/ftp.syslog
  28. SystemLog /var/log/ftp.syslog

  29. #TransferLog log files
  30. TransferLog /var/log/ftp.transferlog

  31. # Normally, we want files to be overwriteable.
  32. <Directory />
  33.   AllowOverwrite                on
  34. </Directory>

  35. # A basic anonymous configuration, no upload directories.  If you do not
  36. # want anonymous users, simply delete this entire <Anonymous> section.
  37. <Anonymous ~ftp>
  38.   User                          ftp
  39.   Group                         ftp

  40.   # We want clients to be able to login with "anonymous" as well as "ftp"
  41.   UserAlias                     anonymous ftp

  42.   # Limit the maximum number of anonymous logins
  43.   MaxClients                    10

  44.   # We want 'welcome.msg' displayed at login, and '.message' displayed
  45.   # in each newly chdired directory.
  46.   DisplayLogin                  welcome.msg
  47.   DisplayFirstChdir             .message

  48.   # Limit WRITE everywhere in the anonymous chroot
  49.   <Limit WRITE>
  50.     DenyAll
  51.   </Limit>
  52. </Anonymous>

  53. <Global>

  54. #设置MySQL认证:
  55. #数据库联接的信息,DatabaseName是数据库名, HostName是主机名,
  56. #Port是端口号,UserName是连接数据库的用户名,Password是密码。
  57. SQLConnectInfo ftp@localhost:3306 FTP 12pps2@

  58. #数据库认证的类型:
  59. SQLAuthTypes Backend Plaintext

  60. #指定用来做用户认证的表的有关信息。("FTPUSERS"和"FTPGRPS"是数据表名字)
  61. SQLUserInfo FTPUSERS userid passwd uid gid home shell

  62. SQLGroupInfo FTPGRPS grpname gid members

  63. #设置如果shell为空时允许用户登录:
  64. RequireValidShell on

  65. #数据库的鉴别
  66. SQLAuthenticate users groups usersetfast groupsetfast

  67. #如果home目录不存在,则系统会为根据它的home项新建一个目录:
  68. SQLHomedirOnDemand on



  69. #磁盘限额部分
  70. QuotaDirectoryTally on

  71. #磁盘限额单位 b"|"Kb"|"Mb"|"Gb"
  72. QuotaDisplayUnits "Kb"

  73. QuotaEngine on

  74. #磁盘限额日志记录
  75. QuotaLog /var/log/Quota.log

  76. # 打开磁盘限额信息,当登陆FTP帐户后,使用命令 "quote SITE QUOTA" 后可显示当前用户的磁盘限额
  77. QuotaShowQuotas on

  78. #以下是SQL调用语句

  79. 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 quotalimits WHERE name = '%{0}' AND quota_type = '%{1}'"

  80. 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 quotatallies WHERE name = '%{0}' AND quota_type = '%{1}'"

  81. 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}'" quotatallies

  82. SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" quotatallies

  83. QuotaLimitTable sql:/get-quota-limit
  84. QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally

  85. </Global>
复制代码


谁能告诉我是怎么回事?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表