免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3427 | 回复: 4

[FTP] 请问我的 proftp 配置文件为什么检测不过呢? [复制链接]

论坛徽章:
0
发表于 2008-12-29 17:59 |显示全部楼层
使用的 proftpd _v 1.3.2 rc2 , 配置文件如下:

      ServerName                      "Server"
ServerType                      Standalone
ServerAdmin                     test@163.com

# Hide as much as possible to outside users
ServerIdent                     on "Welcome to My_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                           nobody

# 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>


# 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            Backend Plaintext
SQLAuthenticate         users* groups*

# used to connect to the database
# databasename@host database_user user_password
SQLConnectInfo  proftpd@localhost proftp proftp

# 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     FTPUSERS userid passwd uid gid home 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    FTPGRPS 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'" FTPUSERS

# Update modified everytime user uploads or deletes a file
SQLLog  STOR,DELE modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" FTPUSERS

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 FREEFORM "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}'" ftpquotatallie

SQLNamedQuery insert-quota-tally FREEFORM "INSERT INTO ftpquotatallies VALUES ('%{0}','%{1}','%{2}','%{3}','%{4}','%{5}','%{6}','%{7}')"

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


RootLogin off
RequireValidShell off




很奇怪的是,每次检测到这个位置的时候就报错了:
[root@local proftp]# ./sbin/proftpd -t
Checking syntax of configuration file
- Fatal: unknown configuration directive 'QuotaEngine' on line 50 of '/usr/local/proftp/etc/proftpd.conf


如果我把这个地方换成数据库的连接字串,一样报错! 望哪位朋友给指点一二!

论坛徽章:
0
发表于 2008-12-29 18:32 |显示全部楼层
这是我的安装参数,  据说1.3.0以后 就不需要额外添加 quota模块,所以直接用一下参数安装,也没有出现任何问题

configure    --prefix=/usr/local/proftp --enable-openssl --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql --with-modules=mod_tls --with-includes=/usr/include/openssl:/usr/local/mysql/include/mysql/ --with-libraries=/usr/lib/openssl:/usr/local/mysql/lib/mysql/

难道是版本的问题?

论坛徽章:
0
发表于 2008-12-29 20:29 |显示全部楼层
以上问题已经解决了, 是在编译安装的时候,参数使用不正确,正确的应该如下:

./configure --prefix=/usr/local/ftp --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_file:mod_quotatab_sql --with-modules=mod_tls --with-includes=/usr/local/mysql/include/mysql/ --with-libraries=/usr/local/mysql/lib/mysql/

由于我的MYSQL是安装在 /usr/local/mysql中,所以我还修改了 /etc/ld.so.conf文件, 添加了 我的mysql 的路径:
/usr/local/mysql/lib/mysql

不过在1.3.2rc3 版本中使用以上配置文件存在一定的问题,首先 SQLHomedirDemand 这个选项不能用, 然后以下语句:

SQLNamedQuery update-quota-tally [red]FREEFORM[/red] "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}'" ftpquotatallie

中的 FREEFORM 只能写成  UPDATE。  语法检测不过!

论坛徽章:
0
发表于 2009-01-04 12:28 |显示全部楼层
最近配1.3.2的proftpd也是相当郁闷,总是不能开启mod_sql

论坛徽章:
0
发表于 2009-01-07 13:32 |显示全部楼层
你可以先查看 连接数据库的日志!  我也是这样 一步一步最后做出来的!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP