GZICP.com   
 
    返回首页
    联系我们
 
 
     

Mod_SQL Mod_Quota

www.gzicp.com   2004年8月22日 22:43:53
 

# (C) www.proftpd.de

# updated 2003-05-12

# by Stonki

 

ServerName "SERVERNAME"

ServerType standalone

ServerAdmin support@proftpd.de

 

 

ServerIdent on "ftp.proftpd.de"

DeferWelcome on

DefaultServer on

Port 21

Umask 022

MaxInstances 30

 

# Normally, we want files to be overwriteable.

<Directory />

AllowOverwrite on

</Directory>

 

#

# FXP Unterstuetzung

#

AllowForeignAddress on

 

# Maximal Werte setzen

MaxClientsPerHost 2 "Nicht mehr als %m Verbindungen"

MaxClients 8 "Leider sind schon %m Clients verbunden"

MaxLoginAttempts 3

 

 

#

# Restart erlauben

#

AllowStoreRestart on

AllowRetrieveRestart on

 

#

# Jail all users into their virtual home dir

#

DefaultRoot ~

 

RequireValidShell off

 

 

#

# Logging options

#

TransferLog /var/log/proftpd.xferlog

 

# Some logging formats

#

LogFormat default "%h %l %u %t \"%r\" %s %b"

LogFormat auth "%v [%P] %h %t \"%r\" %s"

LogFormat write "%h %l %u %t \"%r\" %s %b"

 

# Log file/dir access

ExtendedLog /var/log/proftpd.access_log WRITE,READ write

 

# Record all logins

ExtendedLog /var/log/proftpd.auth_log AUTH auth

 

# Paranoia logging level....

ExtendedLog /var/log/proftpd.paranoid_log ALL default

 

 

 

#------------------------mysql Modul: 4.x

#

# Zugangskontrolle

#

SQLAuthTypes Plaintext

SQLAuthenticate users*

SQLConnectInfo DATENBANK @localhost USERNAME PASSWORT

SQLDefaultGID 65534

SQLDefaultUID 65534

SQLMinUserGID 100

SQLMinUserUID 500

SQLUserInfo users username password uid gid homedir shell

 

#

# aktive SQL Kommandos, ab hier passiert etwas :-)

#

SQLLog PASS counter

SQLNamedQuery counter UPDATE "letzter_zugriff=now(), count=count+1 WHERE username='%u'" users

 

# xfer Log in mysql

SQLLog RETR,STOR transfer1

SQLNamedQuery transfer1 INSERT "'%u', '%f', '%b', '%h', '%a', '%m', '%T',now(), 'c', NULL" xfer_stat

 

SQLLOG ERR_RETR,ERR_STOR transfer2

SQLNamedQuery transfer2 INSERT "'%u', '%f', '%b', '%h', '%a', '%m', '%T',now(), 'i', NULL" xfer_stat

#

# mod_quota tab

#

QuotaEngine on

QuotaShowQuotas on

QuotaLimitTable sql:/get-quota-limit

QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally

 

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 = '%' AND quota_type = '%'"

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 = '%' AND quota_type = '%'"

SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %, bytes_out_used = bytes_out_used + %, bytes_xfer_used = bytes_xfer_used + %, files_in_used = files_in_used + %, files_out_used = files_out_used + %, files_xfer_used = files_xfer_used + % WHERE name = '%' AND quota_type = '%'" quotatallies

SQLNamedQuery insert-quota-tally INSERT "%, %, %, %, %, %, %, %" quotatallies

 

 

最新文章
·Proftpd FAQ汇总  (2004年08月22日)
·proftpd学习笔记(四)  (2004年08月22日)
·proftpd学习笔记(三)  (2004年08月22日)
·proftpd学习笔记(二)  (2004年08月22日)
·proftpd学习笔记(一)  (2004年08月22日)
·Mandrake+Proftpd+MySQL+Quotas  (2004年08月22日)





 
 
Copyright © 1999-2005 GZICP.com All Rights Reserved