zhengwei_zw 发表于 2007-04-24 17:17

proftp真的很爱出问题!最典型的421错误!

proftp真的很爱出问题!最典型的421错误!
我新架一台proftp服务器,系统是bsd6.2 通过ports安装,make config选择好sql 已经限额模块
现在装好了,版本是
sk# pkg_info |grep proftp
proftpd-1.3.1.r2_3Highly configurable ftp daemon
sk#
现在我将另外一台服务器的proftpd.conf 粘贴过来

# 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"
ServerName                        "sk's ftp"
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
MaxLoginAttempts                 3

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


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

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

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

#setup the Restart
AllowRetrieveRestart on
UseReverseDNS off                                    
IdentLookups off
PassivePorts 5555 6666
RootLogin off
RequireValidShell off
TimeoutStalled 600
MaxClients 20
AllowForeignAddress on
AllowStoreRestart on
ServerIdent off
DefaultRoot ~ ftpgroup

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

TimeoutIdle 600

SQLAuthTypes Backend Plaintext

SQLAuthenticate users* groups*

# databasename@host database_user user_password
#SQLConnectInfo ftpdb@localhost proftpd password
SQLConnectInfo proftp@localhost proftp proftp

SQLUserInfo ftpuser userid passwd uid gid homedir shell
SQLGroupInfo ftpgroup groupname gid members
SQLHomedirOnDemand on

# 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 kb
QuotaShowQuotas on
QuotaLog "/var/log/quota"

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


<Directory /home/user>
<Limit WRITE>
</Limit>
</Directory>
数据库也是另外一台生产服务器的结构,现在也将vipw中的ftpuser 和group 的数据添加到了新服务器.然后
#echo "proftpd_enable="yes" > /etc/rc.conf"
#sh /etc/rc
现在#netstat -an|grep 21可以看到ftp已经启动了,但是:
sk# ftp 127.0.0.1
Connected to 127.0.0.1.
421 Service not available, remote server has closed connection.
ftp>

ipfw list
65535 allow ip from any to any

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

#more /var/log/ftp.syslog
Apr 25 01:20:57 sk.com proftpd sk.com (127.0.0.1): ProFTPD terminating (signal 11)
Apr 25 01:20:57 sk.com proftpd sk.com (127.0.0.1): FTP session closed.
#more proftpd.system.log
Apr 24 21:26:30 sk.com proftpd sk.com (localhost.com): ProFTPD terminating (signal 11)
Apr 24 21:26:30 sk.com proftpd sk.com (localhost.com): FTP session closed.
Apr 24 23:16:25 sk.com proftpd sk.com: ProFTPD killed (signal 15)
Apr 24 23:16:25 sk.com proftpd sk.com: ProFTPD 1.3.1rc2 standalone mode SHUTDOWN
Apr 24 23:16:31 sk.com proftpd sk.com: ProFTPD 1.3.1rc2 (devel) (built Tue Apr 24 01:30:34 CST 2007) standalone mode S
TARTUP


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

davex 发表于 2007-04-30 13:34

我也遇到同样问题,正在尝试换mysql 4.1系列的数据库试试,估计是高版本数据库不太兼容

tinging 发表于 2007-08-10 15:41

我是MYSQL5,将配置文件的连接数据库的用户名使用root的,就可以正常登陆了!
页: [1]
查看完整版本: proftp真的很爱出问题!最典型的421错误!