- 论坛徽章:
- 0
|
我是这的proftpd.conf文件
- bash-2.03# more /usr/local/proftpd/etc/proftpd.conf
- ServerName "Server"
- ServerType Standalone
- ServerAdmin 123@15.com
- # Hide as much as possible to outside users
- ServerIdent on "Welcome to the www.spst.cn FTP server. 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
- # databasename@host database_user user_password
- SQLConnectInfo proftpd@localhost 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
复制代码
用户登陆正常,限额也可以用,超过限额就上传不上去了。
但是我用quote SITE QUOTA查看已用空间时,不管上传多少文件ftpquotatallies表中的记录都不更新。在新建用户的时候我在ftpuser和ftpquotalimits表中插入了数据,ftpquotatallies表也会生成相应的记录,只有user和quota_type有值,剩下的都是0,以后我上传数据后再用quote SITE QUOTA查看,还是老样子。看来是根本没有更新,请大家帮我看看。
另外为什么我的proftpd没有日志,在哪儿都找不到
- 230 User testaccount logged in.
- ftp> quote SITE QUOTA
- 200-The current quota for this session are [current/limit]:
- Name: testaccount
- Quota Type: User
- Per Session: True
- Limit Type: Hard
- Uploaded Mb: 0.00/15.00
- Downloaded Mb: 0.00/9.54
- Transferred Mb: 0.00/0.01
- Uploaded files: 0/100000
- Downloaded files: 0/1000000
- Transferred files: 0/10000000
复制代码
下面是我的数据库
- mysql> select * from ftpuser;
- +----+-------------+-----------+------+------+--------------------+---------------+-------+---------------------+---------------------+
- | id | userid | passwd | uid | gid | homedir | shell | count | accessed | modified |
- +----+-------------+-----------+------+------+--------------------+---------------+-------+---------------------+---------------------+
- | 1 | test | passwd | 5000 | 5000 | /home/ftp/chuan | /sbin/nologin | 15 | 2005-12-01 16:12:01 | 2005-12-01 16:23:18 |
- | 2 | test2 | passwd | 5000 | 5000 | /home/ftp/test2 | /sbin/nologin | 11 | 2005-12-01 23:10:14 | 2005-12-01 15:22:03 |
- | 3 | testaccount | ftppasswd | 5500 | 5500 | /home/ftp/test.com | /sbin/nologin | 7 | 2005-12-01 23:45:53 | 2005-12-01 23:43:10 |
- +----+-------------+-----------+------+------+--------------------+---------------+-------+---------------------+---------------------+
- 3 rows in set (0.00 sec)
复制代码
- mysql> select * from ftpgroup;
- +-----------+------+---------+
- | groupname | gid | members |
- +-----------+------+---------+
- | ftpgroup | 5000 | ftpuser |
- +-----------+------+---------+
- 1 row in set (0.00 sec)
复制代码
- mysql> select * from ftpquotalimits;
- +-------------+------------+-------------+------------+----------------+-----------------+------------------+----------------+-----------------+------------------+
- | 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 |
- +-------------+------------+-------------+------------+----------------+-----------------+------------------+----------------+-----------------+------------------+
- | test | user | true | hard | 15728640 | 15728640 | 30000000 | 200 | 200 | 400 |
- | test2 | user | true | hard | 15728640 | 15728640 | 30000000 | 200 | 200 | 400 |
- | testaccount | user | true | hard | 15728640 | 10000000 | 10000 | 100000 | 1000000 | 10000000 |
- +-------------+------------+-------------+------------+----------------+-----------------+------------------+----------------+-----------------+------------------+
- 3 rows in set (0.00 sec)
复制代码
- mysql> select * from ftpquotatallies;
- +-------------+------------+---------------+----------------+-----------------+---------------+----------------+-----------------+
- | name | quota_type | bytes_in_used | bytes_out_used | bytes_xfer_used | files_in_used | files_out_used | files_xfer_used |
- +-------------+------------+---------------+----------------+-----------------+---------------+----------------+-----------------+
- | test | user | 0 | 0 | 0 | 0 | 0 | 0 |
- | test2 | user | 0 | 0 | 0 | 0 | 0 | 0 |
- | testaccount | user | 0 | 0 | 0 | 0 | 0 | 0 |
- +-------------+------------+---------------+----------------+-----------------+---------------+----------------+-----------------+
- 3 rows in set (0.01 sec)
复制代码 |
|