免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6780 | 回复: 2

[FTP] proftp真的很爱出问题!最典型的421错误! [复制链接]

论坛徽章:
0
发表于 2007-04-24 17:17 |显示全部楼层
proftp真的很爱出问题!最典型的421错误!
我新架一台proftp服务器,系统是bsd6.2 通过ports安装,make config选择好sql 已经限额模块
现在装好了,版本是
  1. sk# pkg_info |grep proftp
  2. proftpd-1.3.1.r2_3  Highly configurable ftp daemon
  3. sk#
复制代码

现在我将另外一台服务器的proftpd.conf 粘贴过来

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

  5. #ServerName                        "ProFTPD Default Installation"
  6. ServerName                        "sk's ftp"
  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. MaxLoginAttempts                 3

  22. # Set the user and group under which the server will run.
  23. User                                nobody
  24. #Group                                nogroup
  25. Group                                nobody


  26. # To cause every FTP user to be "jailed" (chrooted) into their home
  27. # directory, uncomment this line.
  28. #DefaultRoot ~
  29. DefaultRoot ~  
  30. #put the proftpd log files in /var/log/ftp.syslog
  31. #SystemLog /var/log/ftp.syslog
  32. SystemLog /var/log/ftp.syslog

  33. #TransferLog log files
  34. #TransferLog /var/log/ftp.transferlog

  35. MaxHostsPerUser 5 "Sorry, you may not connect more than one time 1."
  36. MaxClientsPerUser 13 "Only one such user at a time 2."
  37. MaxClientsPerHost 20 "Sorry, you may not connect more than one time 3."

  38. #setup the Restart
  39. AllowRetrieveRestart on
  40. UseReverseDNS off                                    
  41. IdentLookups off
  42. PassivePorts 5555 6666
  43. RootLogin off
  44. RequireValidShell off
  45. TimeoutStalled 600
  46. MaxClients 20
  47. AllowForeignAddress on
  48. AllowStoreRestart on
  49. ServerIdent off
  50. DefaultRoot ~ ftpgroup

  51. # Normally, we want files to be overwriteable.
  52. AllowOverwrite                on

  53. TimeoutIdle 600

  54. SQLAuthTypes Backend Plaintext

  55. SQLAuthenticate users* groups*

  56. # databasename@host database_user user_password
  57. #SQLConnectInfo ftpdb@localhost proftpd password
  58. SQLConnectInfo proftp@localhost proftp proftp

  59. SQLUserInfo ftpuser userid passwd uid gid homedir shell
  60. SQLGroupInfo ftpgroup groupname gid members
  61. SQLHomedirOnDemand on

  62. # Update count every time user logs in
  63. SQLLog PASS updatecount
  64. SQLNamedQuery updatecount UPDATE "count=count+1,accessed=now() WHERE userid='%u'" ftpuser
  65. # Update modified everytime user uploads or deletes a file
  66. SQLLog STOR,DELE modified
  67. SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser

  68. QuotaEngine on
  69. QuotaDirectoryTally on
  70. QuotaDisplayUnits kb
  71. QuotaShowQuotas on
  72. QuotaLog "/var/log/quota"

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

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

  75. 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

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

  77. QuotaLimitTable sql:/get-quota-limit
  78. QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally


  79. <Directory /home/user>
  80. <Limit WRITE>
  81. </Limit>
  82. </Directory>
复制代码

数据库也是另外一台生产服务器的结构,现在也将vipw中的ftpuser 和group 的数据添加到了新服务器.然后
  1. #echo "proftpd_enable="yes" > /etc/rc.conf"
  2. #sh /etc/rc
复制代码

现在
  1. #netstat -an|grep 21
复制代码
可以看到ftp已经启动了,但是:
  1. sk# ftp 127.0.0.1
  2. Connected to 127.0.0.1.
  3. 421 Service not available, remote server has closed connection.
  4. ftp>
复制代码
  1. ipfw list
  2. 65535 allow ip from any to any
复制代码

不知道这是啥原因,根据个人经验觉得是mysql没有连接上,但是我用proftp 的用户又能登陆!分析了里面的数据结构也是对的.真的找不到原因了!希望有高手帮忙!

  1. #more /var/log/ftp.syslog
  2. Apr 25 01:20:57 sk.com proftpd[938] sk.com (127.0.0.1[127.0.0.1]): ProFTPD terminating (signal 11)
  3. Apr 25 01:20:57 sk.com proftpd[938] sk.com (127.0.0.1[127.0.0.1]): FTP session closed.
  4. #more proftpd.system.log
  5. Apr 24 21:26:30 sk.com proftpd[20163] sk.com (localhost.com[127.0.0.1]): ProFTPD terminating (signal 11)
  6. Apr 24 21:26:30 sk.com proftpd[20163] sk.com (localhost.com[127.0.0.1]): FTP session closed.
  7. Apr 24 23:16:25 sk.com proftpd[20161] sk.com: ProFTPD killed (signal 15)
  8. Apr 24 23:16:25 sk.com proftpd[20161] sk.com: ProFTPD 1.3.1rc2 standalone mode SHUTDOWN
  9. Apr 24 23:16:31 sk.com proftpd[20832] sk.com: ProFTPD 1.3.1rc2 (devel) (built Tue Apr 24 01:30:34 CST 2007) standalone mode S
  10. TARTUP
复制代码

[ 本帖最后由 zhengwei_zw 于 2007-4-24 17:23 编辑 ]

论坛徽章:
0
发表于 2007-04-30 13:34 |显示全部楼层
我也遇到同样问题,正在尝试换mysql 4.1系列的数据库试试,估计是高版本数据库不太兼容

论坛徽章:
0
发表于 2007-08-10 15:41 |显示全部楼层
我是MYSQL5,将配置文件的连接数据库的用户名使用root的,就可以正常登陆了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP