Konfigurace proftpd
TimesGMT off
PassivePorts 60000 65535
LoadModule mod_sql.c
LoadModule mod_sql_mysql.c
LoadModule mod_quotatab.c
LoadModule mod_quotatab_sql.c
SQLAuthTypes plaintext Crypt
SQLConnectInfo db user pass
SQLUserInfo ftp username passwd uid gid homedir shell
SQLUserWhereClause “server = ’server’”
SQLMinID 500
SQLGroupInfo ftpgroup groupname gid members
SQLHomedirOnDemand on
SQLLog PASS updatecount
# Update count every time user logs in
SQLNamedQuery updatecount UPDATE “count=count+1, accessed=now() WHERE username=’%u’” ftpuser
# Update modified everytime user uploads or deletes a file
SQLLog STOR,DELE modified
SQLNamedQuery modified UPDATE “modified=now() WHERE username=’%u’” ftpuser
# User quotas
# ===========
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on
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
SQLNamedQuery gettally SELECT “ROUND((bytes_in_used/1048576),2) FROM ftpquotatallies WHERE name=’%u’”
SQLNamedQuery getlimit SELECT “ROUND((bytes_in_avail/1048576),2) FROM ftpquotalimits WHERE name=’%u’”
SQLNamedQuery getfree SELECT “ROUND(((ftpquotalimits.bytes_in_avail-ftpquotatallies.bytes_in_used)/1048576),2) FROM ftpquotalimits,ftpquotatallies WHERE ftpquotalimits.name = ‘%u’ AND ftpquotatallies.name = ‘%u’”
SQLShowInfo LIST “226″ “Used %{gettally}MB from %{getlimit}MB. You have %{getfree}MB available space.”
ServerName “Letsride ftp server”
ServerIdent on “FTP Server ready.”
ServerAdmin root@localhost
ServerType standalone
#ServerType inetd
DefaultServer on
AccessGrantMsg “User %u logged in.”
#DisplayConnect /etc/ftpissue
#DisplayLogin /etc/ftpmotd
#DisplayGoAway /etc/ftpgoaway
DeferWelcome off
RootLogin off
RequireValidShell off
SystemLog /var/log/proftpd/proftpd.log
# Use this to excude users from the chroot
DefaultRoot ~ !adm
MaxClientsPerUser 7
# Use pam to authenticate by default
#AuthPAMAuthoritative off
DebugLevel 3
# Do not perform ident nor DNS lookups (hangs when the port is filtered)
IdentLookups off
UseReverseDNS off
# Port 21 is the standard FTP port.
Port 21
# odpojovani - anl.cz
TimeoutIdle 200
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022
# Default to show dot files in directory listings
ListOptions “-a”
# See Configuration.html for these (here are the default values)
#MultilineRFC2228 off
#RootLogin off
#LoginPasswordPrompt on
#MaxLoginAttempts 3
#MaxClientsPerHost none
#AllowForeignAddress off # For FXP
# Allow to resume not only the downloads but the uploads too
AllowRetrieveRestart on
AllowStoreRestart on
# 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 200
# Set the user and group that the server normally runs at.
User nobody
Group nobody
# This is where we want to put the pid file
ScoreboardFile /var/run/proftpd.score
# Normally, we want users to do a few things.
AllowOverwrite yes AllowAll
# Define the log formats
LogFormat default “%h %l %u %t \”%r\” %s %b”
LogFormat
Moduly je potreba zavest pokud nejsou built in pomoci LoadModule direktiv viz vyse
V pripade teto chyby
proftpd: symbol lookup error: /usr/libexec/proftpd/mod_quotatab_sql.so: undefined symbol: quotatab_register_backend
Vam nejspise chyby v konfiguraci zavest modul
LoadModule mod_quotatab.c
Dalsi informace o nastaveni DB atd jsou zde:
http://www.howtoforge.com/proftpd_mysql_virtual_hosting
Tags: proftpd mysql quoty