歡迎您光臨本站 註冊首頁

連接proftp伺服器錯誤「伺服器連接被重置」

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

連接proftp伺服器錯誤「伺服器連接被重置」

求救於斑竹了,先謝謝了!!!

連接proftp伺服器是「伺服器連接被重置」
我的proftpd.conf

ServerName                      "ftp Server of sevenboys"
ServerType                      Standalone
ServerAdmin                     [email protected]
UseReverseDNS off
IdentLookups  off
# Hide as much as possible to outside users
ServerIdent                     on "Welcome to the www.sevenboys.net website. Please login..."
DeferWelcome                    on

DefaultServer                   on

# Allow FTP resuming.
# Remember to set to off if you have an incoming ftp for upload.
AllowStoreRestart               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



# User quotas
# ===========
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on
QuotaLog "/usr/local/proftpd/var/log/quota.log"





# The passwords in MySQL are encrypted using CRYPT
SQLAuthTypes            Plaintext Crypt
SQLAuthenticate         users* groups*

# used to connect to the database
# [email protected] database_user user_password
SQLConnectInfo  [email protected] proftpd 123456

# Here we tell ProFTPd the names of the database columns in the "usertable"
# we want it to interact with. Match the names with those in the db
SQLUserInfo     ftpuser userid passwd uid gid homedir shell

# Here we tell ProFTPd the names of the database columns in the "grouptable"
# we want it to interact with. Again the names match with those in the db
SQLGroupInfo    ftpgroup groupname gid members

# set min UID and GID - otherwise these are 999 each
SQLMinID        500

# create a user's home directory on demand if it doesn't exist
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

# User quotas
# ===========
#QuotaEngine on
#QuotaDirectoryTally on
#QuotaDisplayUnits Mb
#QuotaShowQuotas on
#QuotaLog "/usr/local/proftpd/var/log/quota.log"

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



RootLogin off
RequireValidShell off

我用如下命令檢測的結果
/usr/local/proftpd/sbin/proftpd -nd9

localhost.localdomain (221.194.30.48) - ROOT PRIVS at main.c:1011
localhost.localdomain (221.194.30.48) - SETUP PRIVS at main.c:1016
localhost.localdomain (221.194.30.48) - FTP session requested from unknown class
localhost.localdomain (221.194.30.48) - performing module session initializations
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:367
localhost.localdomain (221.194.30.48) - RELINQUISH PRIVS at mod_quotatab.c:369
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:1961
localhost.localdomain (221.194.30.48) - RELINQUISH PRIVS at mod_quotatab.c:1968
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:1977
localhost.localdomain (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) - FTP session closed.
localhost.localdomain - FS: using system lstat()
localhost.localdomain - ROOT PRIVS at main.c:1162
localhost.localdomain - RELINQUISH PRIVS at main.c:1166
localhost.localdomain (221.194.30.48) - ROOT PRIVS at main.c:1011
localhost.localdomain (221.194.30.48) - SETUP PRIVS at main.c:1016
localhost.localdomain (221.194.30.48) - FTP session requested from unknown class
localhost.localdomain (221.194.30.48) - performing module session initializations
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:367
localhost.localdomain (221.194.30.48) - RELINQUISH PRIVS at mod_quotatab.c:369
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:1961
localhost.localdomain (221.194.30.48) - RELINQUISH PRIVS at mod_quotatab.c:1968
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:1977
localhost.localdomain (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) - FTP session closed.
localhost.localdomain - FS: using system lstat()


同時用netstat -nat的檢查結果如下

# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:32768           0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:631           127.0.0.1:32808         ESTABLISHED
tcp        0     48 221.194.30.36:22        221.194.30.48:62619     ESTABLISHED
tcp        0      0 221.194.30.36:22        221.194.30.60:2266      ESTABLISHED
tcp        0      0 221.194.30.36:22        221.194.30.48:61915     ESTABLISHED
tcp        0      0 127.0.0.1:32808         127.0.0.1:631           ESTABLISHED
《解決方案》

debug 信息如下,幫忙看一下,謝謝了

debug 信息如下,幫忙看一下,謝謝了

- parsing '/usr/local/proftpd/etc/proftpd.conf' configuration
- FS: using system open()
- FS: using system read()
- FS: using system read()
- dispatching auth request "getpwnam" to module mod_sql
- dispatching auth request "getpwnam" to module mod_auth_file
- dispatching auth request "getpwnam" to module mod_auth_unix
- dispatching auth request "getgrnam" to module mod_sql
- dispatching auth request "getgrnam" to module mod_auth_file
- dispatching auth request "getgrnam" to module mod_auth_unix
- FS: using system read()
- FS: using system read()
- FS: using system read()
- FS: using system read()
- FS: using system close()
localhost.localdomain -
localhost.localdomain - Config for sever of sevenboys on ftp:
localhost.localdomain - IdentLookups
localhost.localdomain - ServerIdent
localhost.localdomain - DeferWelcome
localhost.localdomain - DefaultServer
localhost.localdomain - AllowStoreRestart
localhost.localdomain - Umask
localhost.localdomain - UserID
localhost.localdomain - UserName
localhost.localdomain - GroupID
localhost.localdomain - GroupName
localhost.localdomain - DefaultRoot
localhost.localdomain - AllowOverwrite
localhost.localdomain - QuotaEngine
localhost.localdomain - QuotaDirectoryTally
localhost.localdomain - QuotaDisplayUnits
localhost.localdomain - QuotaShowQuotas
localhost.localdomain - QuotaLog
localhost.localdomain - SQLAuthTypes
localhost.localdomain - SQLAuthenticate
localhost.localdomain - SQLConnectInfo
localhost.localdomain - SQLUserTable
localhost.localdomain - SQLUsernameField
localhost.localdomain - SQLPasswordField
localhost.localdomain - SQLUidField
localhost.localdomain - SQLGidField
localhost.localdomain - SQLHomedirField
localhost.localdomain - SQLShellField
localhost.localdomain - SQLGroupTable
localhost.localdomain - SQLGroupnameField
localhost.localdomain - SQLGroupGIDField
localhost.localdomain - SQLGroupMembersField
localhost.localdomain - SQLMinID
localhost.localdomain - SQLHomedirOnDemand
localhost.localdomain - SQLLog_PASS
localhost.localdomain - SQLNamedQuery_updatecount
localhost.localdomain - SQLLog_STOR
localhost.localdomain - SQLLog_DELE
localhost.localdomain - SQLNamedQuery_modified
localhost.localdomain - SQLNamedQuery_get-quota-limit
localhost.localdomain - SQLNamedQuery_get-quota-tally
localhost.localdomain - SQLNamedQuery_update-quota-tally
localhost.localdomain - SQLNamedQuery_insert-quota-tally
localhost.localdomain - QuotaLimitTable
localhost.localdomain - QuotaTallyTable
localhost.localdomain - RootLogin
localhost.localdomain - RequireValidShell
localhost.localdomain - dispatching auth request "getgroups" to module mod_sql
localhost.localdomain - dispatching auth request "getgroups" to module mod_auth_file
localhost.localdomain - dispatching auth request "getgroups" to module mod_auth_unix
localhost.localdomain - SETUP PRIVS at main.c:2704
localhost.localdomain - ROOT PRIVS at main.c:1956
localhost.localdomain - RELINQUISH PRIVS at main.c:1962
localhost.localdomain - ROOT PRIVS at main.c:2323
localhost.localdomain - opening scoreboard '/usr/local/proftpd/var/proftpd/proftpd.scoreboard'
localhost.localdomain - RELINQUISH PRIVS at main.c:2347
localhost.localdomain - ROOT PRIVS at inet.c:452
localhost.localdomain - RELINQUISH PRIVS at inet.c:510
localhost.localdomain - ProFTPD 1.2.9 (stable) (built 日 12月 4 06:25:55 CST 2005) standalone mode STARTUP
localhost.localdomain - ROOT PRIVS at main.c:2171
localhost.localdomain - RELINQUISH PRIVS at main.c:2177
localhost.localdomain - FS: using system lstat()
localhost.localdomain - ROOT PRIVS at main.c:1150
localhost.localdomain - RELINQUISH PRIVS at main.c:1154
localhost.localdomain (221.194.30.48) - ident lookup disabled
localhost.localdomain (221.194.30.48) - ROOT PRIVS at main.c:977
localhost.localdomain (221.194.30.48) - SETUP PRIVS at main.c:982
localhost.localdomain (221.194.30.48) - performing module session initializations
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:366
localhost.localdomain (221.194.30.48) - RELINQUISH PRIVS at mod_quotatab.c:368
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:1922
localhost.localdomain (221.194.30.48) - RELINQUISH PRIVS at mod_quotatab.c:1929
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:1938
localhost.localdomain (221.194.30.48) - RELINQUISH PRIVS at mod_quotatab.c:1945
localhost.localdomain (221.194.30.48) - error deleting scoreboard entry: Invalid argument
localhost.localdomain (221.194.30.48) - FTP session closed.
localhost.localdomain - FS: using system lstat()
localhost.localdomain - FS: using system lstat()
localhost.localdomain - scrubbing scoreboard
localhost.localdomain - ROOT PRIVS at mod_core.c:194
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:201
localhost.localdomain - ROOT PRIVS at mod_core.c:223
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:251
localhost.localdomain - FS: using system lstat()
localhost.localdomain - scrubbing scoreboard
localhost.localdomain - ROOT PRIVS at mod_core.c:194
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:201
localhost.localdomain - ROOT PRIVS at mod_core.c:223
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:251
localhost.localdomain - FS: using system lstat()
localhost.localdomain - scrubbing scoreboard
localhost.localdomain - ROOT PRIVS at mod_core.c:194
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:201
localhost.localdomain - ROOT PRIVS at mod_core.c:223
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:251
localhost.localdomain - FS: using system lstat()
localhost.localdomain - ROOT PRIVS at main.c:1150
localhost.localdomain - RELINQUISH PRIVS at main.c:1154
localhost.localdomain (221.194.30.48) - ident lookup disabled
localhost.localdomain (221.194.30.48) - ROOT PRIVS at main.c:977
localhost.localdomain (221.194.30.48) - SETUP PRIVS at main.c:982
localhost.localdomain (221.194.30.48) - performing module session initializations
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:366
localhost.localdomain (221.194.30.48) - RELINQUISH PRIVS at mod_quotatab.c:368
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:1922
localhost.localdomain (221.194.30.48) - RELINQUISH PRIVS at mod_quotatab.c:1929
localhost.localdomain (221.194.30.48) - ROOT PRIVS at mod_quotatab.c:1938
localhost.localdomain (221.194.30.48) - RELINQUISH PRIVS at mod_quotatab.c:1945
localhost.localdomain - FS: using system lstat()
localhost.localdomain - FS: using system lstat()
localhost.localdomain (221.194.30.48) - error deleting scoreboard entry: Invalid argument
localhost.localdomain (221.194.30.48) - FTP session closed.
localhost.localdomain - FS: using system lstat()
localhost.localdomain - scrubbing scoreboard
localhost.localdomain - ROOT PRIVS at mod_core.c:194
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:201
localhost.localdomain - ROOT PRIVS at mod_core.c:223
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:251
localhost.localdomain - FS: using system lstat()
localhost.localdomain - scrubbing scoreboard
localhost.localdomain - ROOT PRIVS at mod_core.c:194
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:201
localhost.localdomain - ROOT PRIVS at mod_core.c:223
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:251
localhost.localdomain - FS: using system lstat()
localhost.localdomain - scrubbing scoreboard
localhost.localdomain - ROOT PRIVS at mod_core.c:194
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:201
localhost.localdomain - ROOT PRIVS at mod_core.c:223
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:251
localhost.localdomain - FS: using system lstat()
localhost.localdomain - scrubbing scoreboard
localhost.localdomain - ROOT PRIVS at mod_core.c:194
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:201
localhost.localdomain - ROOT PRIVS at mod_core.c:223
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:251
localhost.localdomain - FS: using system lstat()
localhost.localdomain - scrubbing scoreboard
localhost.localdomain - ROOT PRIVS at mod_core.c:194
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:201
localhost.localdomain - ROOT PRIVS at mod_core.c:223
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:251
localhost.localdomain - FS: using system lstat()
localhost.localdomain - scrubbing scoreboard
localhost.localdomain - ROOT PRIVS at mod_core.c:194
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:201
localhost.localdomain - ROOT PRIVS at mod_core.c:223
localhost.localdomain - RELINQUISH PRIVS at mod_core.c:251
localhost.localdomain - FS: using system lstat()

《解決方案》

proftp模塊信息


# ./proftpd -l
Compiled-in modules:
  mod_core.c
  mod_xfer.c
  mod_auth_unix.c
  mod_auth_file.c
  mod_auth.c
  mod_ls.c
  mod_log.c
  mod_site.c
  mod_auth_pam.c
  mod_sql.c
  mod_sql_mysql.c
  mod_quotatab.c
  mod_quotatab_sql.c
  mod_cap.c
《解決方案》

先不用mod_sql,用最基本的配置,可以連接嗎?

按照這個說的

Question: Why do I see "error deleting scoreboard entry: Invalid argument"?
Answer: This log message almost always denotes use of mod_sql, and a problem in the mod_sql configuration. To debug the problem, define an SQLLogFile (making sure the path is not in a world-writable directory), to which mod_sql will write debugging information.

設置SQLLogFile,看看有沒有什麼
《解決方案》

不用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     [email protected]伺服器名 username password
#proftpdb是密碼
#(如果沒有密碼留空)
SQLConnectInfo [email protected] 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) - 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) - FTP session closed.
localhost.localdomain - FS: using system lstat()

proftp在運行
《解決方案》

SQLLogFile設置了嗎
《解決方案》

稍等,正在設置。。。。。

稍等,正在設置。。。。。
《解決方案》

我重新make的時候,出現mysql.h沒有找到

我查看,/proftpd-1.2.10/contrib
mod_sql_mysql.c
有如下的全局變數,其中
#define _MOD_VERSION "mod_sql_mysql/4.04"
顯示的版本號是4.04,我裝的mysql版本是4.15
是否可以???

#define _MOD_VERSION "mod_sql_mysql/4.04"

#define _MYSQL_PORT "3306"

#include <mysql.h>
#include "conf.h"
#include "../contrib/mod_sql.h"
《解決方案》

這個應該沒什麼影響
《解決方案》

謝謝,那我就繼續安裝!

我剛才忘了裝mysql的devel包,我剛裝上,我再試一下!

[火星人 ] 連接proftp伺服器錯誤「伺服器連接被重置」已經有641次圍觀

http://coctec.com/docs/service/show-post-13784.html