proftpd+mysql用户认证+quota磁盘限额
发表于:2007-05-25来源:作者:点击数:
标签:
proftpd+mysql用户认证+quota磁盘限额 整理编辑:mars(mars_diy@21cn.com) 网上关于proftpd的安装文章实在是不少,我只是稍微整理了一下,并且使用了新的quota磁盘限额模块 由于proftpd最新版1.2.8目前还是RC版,加上有些设置不能通用,所以在这里还是使用1.
proftpd+mysql用户认证+quota磁盘限额
整理编辑:mars (mars_diy@21cn.com)
网上关于proftpd的安装文章实在是不少,我只是稍微整理了一下,并且使用了新的 quota磁盘限额模块
由于proftpd最新版1.2.8目前还是RC版,加上有些设置不能通用, 所以在这里还是使用1.2.7版
首先下载源码
proftpd1.2.7:
ftp://ftp.proftpd.org/distrib/sourc...d-1.2.7.tar.bz2
mod_quotatab-1.2.4 (1.2.5 版本的mod_quotatab是用在最新的1.2.8rc1上的)
http://www.castaglia.org/proftpd/mo...ab-1.2.4.tar.gz
假定你的机器上已经安装好了mysql
开始编译安装
将proftpd的源码包解压缩到某临时目录下:
localhost proftpd # tar -jxvf proftpd-1.2.7.tar.bz2
解压缩 mod_quotatab-1.2.4
localhost proftpd # tar -zxvf proftpd-mod-quotatab-1.2.4.tar.gz
进入 mod_quotatab 目录
localhost proftpd # cd mod_quotatab
把mod_quotatab中的文件拷贝到 proftpd 中的modules 目录中
localhost mod_quotatab # cp * ../proftpd-1.2.7/modules
在开始运行configure之前,我们要先改动一个文件
进入 proftpd-1.2.7/contrib 目录
localhost mod_quotatab # cd ../proftpd-1.2.7/contrib
修改 mod_sql_mysql.c
localhost contrib # vi mod_sql_mysql.c
找到#include <mysql/mysql.h> 把他该为你实际路径
如果你的mysql 安装在 /usr/local/mysql 下,就把它修改为#include </usr/local/mysql/include/mysql/mysql.h>r
然后
localhost contrib # cd ..
localhost proftpd-1.2.7 # cd ..
localhost proftpd #./configure --prefix=DIR --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql --with-includes=DIR --with-libraries=DIR
需要修改的三个地方
--prefix=DIR 你要安装到哪里
--with-includes=DIR mysql 的includes 目录
--with-libraries=DIR mysql 的lib 目录
然后
make
make install 完成安装
接下来,进入你安装好的proftpd目录 ,修改etc/proftpd.conf 文件开始配置
基本配置我就不多说了,网上这类文章有很多,实在不会的话,自己找找就是了,这里主要介绍如何配置mysql用户认证和磁盘限额
mysql 用户认证部分:
在proftpd.conf中加入以下内容
#设置
MySQL认证:
#数据库联接的信息,DatabaseName是数据库名, HostName是主机名,
#Port是端口号,UserName是连接数据库的用户名,Password是密码。
SQLConnectInfo DatabaseName@HostName:port UserName Password
#数据库认证的类型:
SQLAuthTypes Backend Plaintext
#指定用来做用户认证的表的有关信息。("FTPUSERS"和"FTPGRPS"是数据表名字,等一会而在下面建立)
SQLUserInfo FTPUSERS userid passwd uid gid homedir shell
SQLGroupInfo FTPGRPS groupname gid members
#设置如果shell为空时允许用户登录:
RequireValidShell off
#数据库的鉴别
SQLAuthenticate users groups usersetfast groupsetfast
#如果home目录不存在,则系统会为根据它的home项新建一个目录:
SQLHomedirOnDemand on
然后在这个数据库中建立一个用户表FTPUSERS,这个表是必须的:
use FTP;
create table FTPUSERS (
userid TEXT NOT NULL,
passwd TEXT NOT NULL,
uid INT NOT NULL,
gid INT NOT NULL,
home TEXT,
shell TEXT
);
此表格是为了用户认证所需要的,其中userid、passwd是必不可少的,userid是用做FTP服务的用户名;passwd是指此用户的密码;uid是系统用户的ID,也就是所映射的系统用户;gid是所属系统组的ID;home是该用户所在的HOME目录;shell可以为该用户指定相应的shell。当然你可以建立更多的字段,例如:用来记录用户登录次数的count,或者是日期的date,如果你对配置熟悉了之后,你可以根据自己的喜欢添加更多的功能。在此就不多讲。
3、如果你想需要所有的功能,你还可以添加另外一个需要的表:FTPGRPS,也就是确定组的表格,当然也可以不用,这里讲一个它的格式:
create table FTPGRPS (
grpname TEXT NOT NULL,
gid SMALLINT NOT NULL,
members TEXT NOT NULL,
);
其中grpname是组的名称,gid是系统组的ID,members是组的成员。注意:多成员,他们之间要用逗号隔开,不能使用空格。
4、为空表格插入记录:
INSERT INTO FTPUSERS (userid, passwd, uid, gid, home, shell)
valueS ('user1', '999999', '1000', '1000', '/home/FTP/user1', '' );
按此格式你可以插入这每一个用户添加一个记录。
如果你要想应用到更多的功能,且建立了组的表格,你也要为此添加记录,不过一定要注意在members的字段多个成员一定要用逗号隔开。
INSERT INTO FTPGRPS VALUES ('FTPGRPS', 1000, 'FTPUSR');
四、为FTP用户建立相应的系统用户。
在本例中,只整个FTP服务只提供一个有效的系统用户FTPUSR和组FTPGRP,当然你也可以设置多个系统用户。但出于
安全的考虑,我只设一个,用他来启动FTP daemon,并把所有的FTP用户映射过这个用户。
先建立FTPGRP组:
groupadd -g 1000 -r FTPGRP
建立FTPUSR用户:
adduser -u 1000 -g 1000 -d /home/FTP -s /bin/bash -r FTPUSR
为FTPUSR建立HOME,把所有的FTP user 活动空间全放在此目录下:
mkdir /home/FTP
chown FTPUSR /home/FTP
chgrp FTPGRP /home/FTP
到这里MYSQL认证部分就算基本配置好了,接下来是磁盘限额部分
首先,还是编辑proftpd文件
#磁盘限额部分
QuotaDirectoryTally on
#磁盘限额单位 b"|"Kb"|"Mb"|"Gb"
QuotaDisplayUnits "Kb"
QuotaEngine on
#磁盘限额日志记录
QuotaLog "你的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 quotalimits \
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 quotatallies \
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}'" quotatallies
SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" quotatallies
QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally
然后建立mysql 数据表
CREATE TABLE quotalimits (
name VARCHAR(30),
quota_type ENUM("user", "group", "class", "all") NOT NULL,
per_session ENUM("false", "true") NOT NULL,
limit_type ENUM("soft", "hard") NOT NULL,
bytes_in_avail FLOAT NOT NULL,
bytes_out_avail FLOAT NOT NULL,
bytes_xfer_avail FLOAT NOT NULL,
files_in_avail INT UNSIGNED NOT NULL,
files_out_avail INT UNSIGNED NOT NULL,
files_xfer_avail INT UNSIGNED NOT NULL
);
CREATE TABLE quotatallies (
name VARCHAR(30) NOT NULL,
quota_type ENUM("user", "group", "class", "all") NOT NULL,
bytes_in_used FLOAT NOT NULL,
bytes_out_used FLOAT NOT NULL,
bytes_xfer_used FLOAT NOT NULL,
files_in_used INT UNSIGNED NOT NULL,
files_out_used INT UNSIGNED NOT NULL,
files_xfer_used INT UNSIGNED NOT NULL
);
说明一下,quotatallies表不需要作修改,它记录了用户当前的磁盘使用情况,由程序自动记录
要注意的是quotalimits 表中一些字段的含意
quota_type 磁盘限额的鉴别,可以设置单各用户,也可以设置一各组中的全部用户,还可以设置全部用户
bytes_in_avail 上传最大字节数,就是FTP用户空间容量 (设置个字段的时候是以byte(字节)为单位,如果要限额在10M,那就是10240000,下面也一样)
bytes_out_avail 下载最大字节数,需要注意的是,这个字段中记录的是用户总共能从
服务器上下载多少数据,数据是累计的。
bytes_xfer_avail 总共可传输的文件的最大字节数(上传和下载流量)需要注意的是,这个字段中记录的是用户总共能传输文件的最大字节数,数据是累计的。
files_in_avail INT 总共能上传文件的数目
files_out_avail INT 能从服务器上下载文件的总数目
files_xfer_avail INT 总共可传输文件的数目(上传和下载)
好了,开始使用磁盘限额,我们要将上面建立的user1帐号给予10M空间,最多能上传500个文件到服务器上,文件传输流量为20M,只能传输10个文件。只要在MYSQL中
插入
INSERT INTO `quotalimits` ( `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` )
VALUES ('user1', 'user', 'false', 'soft', '10240000', '0', '2048000', '500', '0', '10');
就可以了,不需要设置的部分用0代替就可以了
现在运行proftpd,登陆到user1 ,使用quote SITE QUOTA 就会显示user1用户的磁盘使用情况
ftp> quote SITE QUOTA
200-The current quota for this session are [current/limit]:
Name: user1
Quota Type: User
Per Session: False
Limit Type: Soft
Uploaded Kb: 0.00/10000.00
Downloaded Kb: unlimited
Transferred Kb: 0.00/2000.00
Uploaded files: 0/500
Downloaded files: unlimited
Transferred files: 0/10
200 Please contact root@localhost if these entries are inaccurate
OK,安装完毕
(转)
白狐狸 回复于:2003-01-18 12:01:45
|
天啊,又是抱错,我该怎么办
Proftpd-1.2.7.tar.gz
proftpd-mod-quotatab-1.2.4.tar.gz
Mysql- 3.23.41 (已安装在/usr/local/mysql)
在make的时候出错,错误代码:
/usr/libexec/elf/ld: cannot find -lmysqlclient
*** Error code 1
Stop in /usr/local/src/proftpd-1.2.7.
在google上查找mysqlclient,也得到什么结果,郁闷啊
|
白狐狸 回复于:2003-01-18 17:35:15
|
proftpd+mysql用户认证已经搞定,但就是加不上quota功能
|
wind521 回复于:2003-01-18 20:09:55
|
[quote:ee9f7b41f5="白狐狸"]天啊,又是抱错,我该怎么办
Proftpd-1.2.7.tar.gz
proftpd-mod-quotatab-1.2.4.tar.gz
Mysql- 3.23.41 (已安装在/usr/local/mysql)
在make的时候出错,错误代码:
/usr/libexec/elf/ld: cannot find -lmy..........[/quote:ee9f7b41f5]
机器有mysql的client端的程序吗?
|
nbpanda 回复于:2003-01-21 10:20:37
|
[quote:f57028f8af="白狐狸"]proftpd+mysql用户认证已经搞定,但就是加不上quota功能[/quote:f57028f8af]
我也是 quota 功能加不上去,quote SITE QUOTA 回答如下:
No quotas in effect
|
nbpanda 回复于:2003-01-21 11:00:07
|
已经做好,但是这个quota 的功能没有 系统的quota 来的好,一个可以立刻阻断,比较好
|
白狐狸 回复于:2003-01-21 11:49:21
|
proftpd+mysql用户认证方式我在FreeBSD4.6上配置成功了,但用同样的方法却在4.7和5.0上却出错,错误代码为:
用/usr/local/ftp/sbin/proftpd -n 来起动ftp服务时,提示下面的 错误
/usr/local/ftp/sbin/proftpd: error while loading shared libraries: libmysqlclient.so.10: cannot open shared object file: No such file or directory
|
o叶大马猴 回复于:2003-01-21 11:53:22
|
[quote:f2b8e5d83c="白狐狸"]proftpd+mysql用户认证方式我在FreeBSD4.6上配置成功了,但用同样的方法却在4.7和5.0上却出错,错误代码为:
用/usr/local/ftp/sbin/proftpd -n 来起动ftp服务时,提示下面的 错误
/usr/local/ftp/sbin/proftpd: e..........[/quote:f2b8e5d83c]
少了个文件....
有关 mysqlclient的...
|
白狐狸 回复于:2003-01-21 11:55:06
|
配置使Proftpd支持MySQL认证:
#./configure --prefix=/usr/local/proftpd \
--with-modules=mod_sql:mod_sql_mysql \
--with-includes=/usr/local/mysql/include/mysql \
--with-libraries=/usr/local/mysql/lib/mysql
# make
# make install
应该不会出现找不到的情况啊,我mysql装在/usr/local/mysql,并且运行良好,怎么回事啊,在4.6上就没这个问题啊,libmysqlclient.so.10这个文件在/usr/local/mysql/lib/mysql/libmysqlclient.so.10,也是存在的呀
|
白狐狸 回复于:2003-01-22 23:02:27
|
安装mysql时,将mysql库所在的目录添加进配置文件中,例如
echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
然后执行ldconfig -v|grep libmysqlclient ,再试试!
所有问题得到解决,用起来的感觉就是爽,更重要的是你还可以在数据库添加更多的功能和记录更多的记录啊,谢谢
|
luj 回复于:2003-01-29 21:33:00
|
我的QUOTA加上去不能登陆,报错421 Service not available,remote server has closed connection Login failed
不加QUOTA没事,是什么原因??可以把你们成功的proftpd.conf发给我参考一下吗,急
E-MAIL:luj@xxsb.com
|
白狐狸 回复于:2003-02-08 10:08:01
|
现在偶把偶的proftpd配置文件贴出来,希望对你有所帮助,嘿嘿
ServerName "白狐狸's 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
#limit the user in his owner directory
DefaultRoot ~
#put the proftpd log files in /var/log/ftp.syslog
SystemLog /var/log/ftp.syslog
#TransferLog log files
TransferLog /var/log/ftp.transferlog
#set The maxtimes user Attempts times
MaxLoginAttempts 3
#setup the Restart
AllowRetrieveRestart on
#setup the download and upload speed
RateReadBPS 80000
RateWriteBPS 80000
#setup the disk quota
QuotaDirectoryTally on
#quota b"|"Kb"|"Mb"|"Gb"
#setup the disk quota
QuotaDirectoryTally on
#quota b"|"Kb"|"Mb"|"Gb"
QuotaDisplayUnits Kb
QuotaEngine on
QuotaLog /var/ftp/Quota.log
QuotaShowQuotas on
# We put our mod_sql directives in a <Global> block so they'll be
# inherited by the <Anonymous> block below, and any other <VirtualHost>
# blocks we may want to add. For a simple server these don't need to
# be in a <Global> block but it won't hurt anything.
<Global>
# Specify our connection information. Both mod_sql_mysql and
# mod_sql_postgres use the same format, other backends may specify a
# different format for the first argument to SQLConnectInfo. By not
# specifying a fourth argument, we're defaulting to 'PERSESSION'
# connections -- a connection is made to the database at the start of
# the session and closed at the end. This should be fine for most
# situations.
# SQLConnectInfo dbname@host:port username password
SQLConnectInfo ftp@localhost:3306 root 12345678
# Specify our authentication schemes. Assuming we're using
# mod_sql_mysql, here we're saying 'first try to authenticate using
# mysql's password scheme, then try to authenticate the user's
# password as plaintext'. Note that 'Plaintext' isn't a smart way to
# store passwords unless you've got your database well secured.
SQLAuthTypes Backend Plaintext
# Specify the table and fields for user information. If you've
# created the database as it specifies in 'README.mod_sql', you don't
# need to have this directive at all UNLESS you've elected not to
# create some fields. In this case we're telling mod_sql to look in
# table 'users' for the fields 'username','password','uid', and
# 'gid'. The 'homedir' and 'shell' fields are specified as 'NULL' --
# this will be explained below.
# SQLUserInfo users username password uid gid NULL NULL
SQLUserInfo ftpusers userid passwd uid gid home shell
# Here we tell mod_sql that every user it authenticates should have
# the same home directory. A much more common option would be to
# specify a homedir in the database and leave this directive out. Note
# that this directive is necessary in this case because we specified
# the homedir field as 'NULL', above. mod_sql needs to get homedir
# information from *somewhere*, otherwise it will not allow access.
# SQLDefaultHomedir "/tmp"
# This is not a mod_sql specific directive, but it's here because of
# the way we specified 'SQLUserInfo', above. By setting this to
# 'off', we're telling ProFTPD to allow users to connect even if we
# have no (or bad) shell information for them. Since we specified the
# shell field as 'NULL', above, we need to tell ProFTPD to allow the
# users in even though their shell doesn't exist.
RequireValidShell off
# Here we tell mod_sql how to get out group information. By leaving
# this commented out, we're telling mod_sql to go ahead and use the
# defaults for the tablename and all the field names.
# SQLGroupInfo groups groupname gid members
# For small sites, the following directive will speed up queries at
# the cost of some memory. Larger sites should read the complete
# description of the 'SQLAuthenticate' directive; there are options
# here that control the use of potentially expensive database
# queries. NOTE: these arguments to 'SQLAuthoritative' limit the way
# you can structure your group table. Check the README for more
# information.
SQLAuthenticate users
# Finally, some example logging directives. If you have an integer
# field named 'count' in your users table, these directives will
# automatically update the field each time a user logs in and display
# their current login count to them.
# SQLNamedQuery getcount SELECT "count, userid from users where userid='%u'"
# SQLNamedQuery updatecount UPDATE "count=count+1 WHERE userid='%u'" users
# SQLShowInfo PASS "230" "You've logged on %{getcount} times, %u"
# SQLLog PASS updatecount
SQLHomedirOnDemand 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 quotalimits 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 quotatallies 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}'" quotatallies
SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" quotatallies
QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally
# close our <Global> block.
</Global>
# 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 normal user and group permissions for the server.
User ftpusr
Group ftpgrp
# Normally, we want files to be overwriteable.
<Directory /*>
AllowOverwrite on
</Directory>
# A basic anonymous configuration, no upload directories. If you
# don't want to support anonymous access, simply remove this
# <Anonymous ..> ... </Anonymous> block.
<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>
|
lazylee 回复于:2003-02-10 21:12:12
|
楼顶“找到#include <mysql/mysql.h> 把他该为你实际路径”可以用编译时加入 --with-mysql=/usr/local/mysql 代替
找不到 mysqlclient 可以的另一个解决办法是把 /usr/local/mysql/lib/mysql 下的东西拷到 /usr/local/lib 下
|
白狐狸 回复于:2003-02-10 21:58:15
|
[quote:354fcfaa76="lazylee"]楼顶“找到#include <mysql/mysql.h> 把他该为你实际路径”可以用编译时加入 --with-mysql=/usr/local/mysql 代替
找不到 mysqlclient 可以的另一个解决办法是把 /usr/local/mysql/lib/mysql 下的东西拷到 ..........[/quote:354fcfaa76]
你实际做了没??不要凭空想当然好不好,拜托!!
|
lazylee 回复于:2003-02-10 23:29:05
|
我当然这么做了,你如果没试过就不要着急反驳我
|
白狐狸 回复于:2003-02-11 00:10:09
|
”找不到 mysqlclient 可以的另一个解决办法是把 /usr/local/mysql/lib/mysql 下的东西拷到 /usr/local/lib 下“
这个办法谁都能想到呀,但我在FreeBSD下试过了,通不过
|
lazylee 回复于:2003-02-11 11:28:24
|
sorry,笔误,昨天晚上困了,我是拷到 /usr/lib 下了,正常使用中
|
haohaoo 回复于:2003-02-11 14:28:26
|
good
|
luj 回复于:2003-02-17 15:35:34
|
proftpd+Mysql搞好,还是老问题
我的QUOTA加上去不能登陆,报错421 Service not available,remote server has closed connection Login failed
不加QUOTA没事,是什么原因,就教成功的人!!
|
henkon 回复于:2003-02-19 18:39:10
|
groupadd –g 1000 –r FTPGRP
出现groupadd:Command not found??是什么回事??
|
白狐狸 回复于:2003-02-20 09:31:45
|
[quote:0029301de5="henkon"]groupadd –g 1000 –r FTPGRP
出现groupadd:Command not found??是什么回事??[/quote:0029301de5]
pw groupadd –g 1000 –r FTPGRP
|
henkon 回复于:2003-02-20 19:02:17
|
出现新的问题在下面这步的时候出现 ERROR 1064:You have an error in your SQL syntax near ')' at line 12怎么办???
CREATE TABLE quotalimits (
name VARCHAR(30),
quota_type ENUM("user", "group", "class", "all") NOT NULL,
per_session ENUM("false", "true") NOT NULL,
limit_type ENUM("soft", "hard") NOT NULL,
bytes_in_avail FLOAT NOT NULL,
bytes_out_avail FLOAT NOT NULL,
bytes_xfer_avail FLOAT NOT NULL,
files_in_avail INT UNSIGNED NOT NULL,
files_out_avail INT UNSIGNED NOT NULL,
files_xfer_avail INT UNSIGNED NOT NULL,
);
|
白狐狸 回复于:2003-02-20 19:19:53
|
照样考过去就是呀,
CREATE TABLE quotalimits (
name VARCHAR(30),
quota_type ENUM("user", "group", "class", "all") NOT NULL,
per_session ENUM("false", "true") NOT NULL,
limit_type ENUM("soft", "hard") NOT NULL,
bytes_in_avail FLOAT NOT NULL,
bytes_out_avail FLOAT NOT NULL,
bytes_xfer_avail FLOAT NOT NULL,
files_in_avail INT UNSIGNED NOT NULL,
files_out_avail INT UNSIGNED NOT NULL,
files_xfer_avail INT UNSIGNED NOT NULL
);
|
lazylee 回复于:2003-02-21 09:18:40
|
es_xfer_avail INT UNSIGNED NOT NULL,
这行最后不能有 ,
|
henkon 回复于:2003-02-21 18:13:13
|
[quote:b9cf9056a8="白狐狸"]照样考过去就是呀,
CREATE TABLE quotalimits (
name VARCHAR(30),
quota_type EENUM("user", "group", "class", "all") NOT NULL,
per_session ENUM("false", "true") NOT NULL,
limit_type ENUM("soft"..........[/quote:b9cf9056a8]
是考到proftpd.conf中吗?而不是在FTP里直接建数据表吗?如果拷的话怎么拷?我是新人,请白狐狸兄指点迷津
|
白狐狸 回复于:2003-02-21 20:22:39
|
[quote:b3e59e4ae4="henkon"]
是考到proftpd.conf中吗?而不是在FTP里直接建数据表吗?如果拷的话怎么拷?我是新人,请白狐狸兄指点迷津[/quote:b3e59e4ae4]
就是直接在Mysql中建立表呀,通过phpmyadmin即可
|
dykeyer 回复于:2003-02-23 17:39:28
|
谢谢了,
|
henkon 回复于:2003-03-05 17:25:57
|
为什么我建组的数据表的时候出现错误??
create table FTPGRPS (
grpname TEXT NOT NULL,
gid SMALLINT NOT NULL,
members TEXT NOT NULL,
);
|
| henkon 回复于:2003-03-05 17:29:34
| 那位好心的兄弟可以把你的*.sql直接发给我,白狐狸兄不知道你是否可以发给我?先谢谢了,我的邮箱是henkon@163.net
| henkon 回复于:2003-03-05 17:52:42
| 建立FTPUSR用户的时候也出错:
adduser –u 1000 –g 1000 –d /home/FTP –s /bin/bash –r FTPUSR
/etc/adduser.conf:No such file or directory
| 白狐狸 回复于:2003-03-05 22:15:35
| [quote:e27d216cf0="henkkon"]建立FTPUSR用户的时候也出错:
adduser –u 1000 –g 1000 –d /home/FTP –s /bin/bash –r FTPUSR
/etc/adduser.conf:No such file or directory[/quote:e27d216cf0]
pw adduser –u 1000 –g 1000 –d /home/FTP –s /bin/bash FTPUSR
| 白狐狸 回复于:2003-03-05 22:20:35
| [quote:feeeb9e24f="henkon"]为什么我建组的数据表的时候出现错误??
create table FTPGRPS (
grpname TEXT NOT NULL,
gid SMALLINT NOT NULL,
members TEXT NOT NULL,
);[/quote:feeeb9e24f]
哎,
create table FTPGRPS (
grpname TEXT NOT NULL,
gid SMALLINT NOT NULL,
members TEXT NOT NULL
);
看看他们的区别哦 :lol: :lol:
| isthisrabit 回复于:2003-03-06 01:36:56
| http://free.tcvec.js.cn
一个简单的管理用户小程序,如有好的通知我
| 白狐狸 回复于:2003-03-06 02:01:32
| [quote:1ffccf961b="isthisrabit"]http://free.tcvec.js.cn
一个简单的管理用户小程序,如有好的通知我[/quote:1ffccf961b]
谁有这个源代码吗,我想要一个研究啊
| songxi0354 回复于:2003-03-06 10:55:43
| :oops: 在FreeBSD4.6下安装proftpd+mysql+quota需要开启系统的磁盘限额?也就是重新编译内核?
| 白狐狸 回复于:2003-03-06 13:24:12
| 其实不用系统自身的磁盘限额功能,通过proftpd的限额功能也是能做到的
| isthisrabit 回复于:2003-03-06 18:27:20
| 最好别用系统的磁盘限额,应用proftpd的第三方软件,
ftp://pooh.urbanrage.com/pub/c
mod_quota.c
当时我在设置时就因它(系统的)出过很大的问题.最后把它删除后就没事了,用了五个月左右一直很稳定
| xurwxj 回复于:2003-04-21 19:58:30
| 我这边出现/usr/bin/ld:cannt open lz是什么错误
| proftpd 回复于:200-04-25 18:16:49
| [quote:14c27e1e81="isthisrabit"]http://free.tcvec.js.cn
一个简单的管理用户小程序,如有好的通知我[/quote:14c27e1e81]
还可以喔!! :lol:
| wwl 回复于:2003-05-24 12:56:47
| 磁盘限额处不好用,我在
ftp>quote SITE QUOTA提示
202 no quotas in effect
| netkiller 回复于:2003-05-30 15:20:57
| 我全实现了。。。。做成功了!!!
Proftpd + MySQL 不喜欢。
Proftpd + Postgresql 比较喜欢。。
Proftpd + OpenLDAP 我最喜欢
| ghost_diy 回复于:2003-06-09 11:16:15
| 这里的FTP磁盘限额是用户累计上传了多少byte的文件,而不是现在用户究竟使用了多少空间,这有什么意思?!!
| NightKids 回复于:2003-07-03 09:45:51
| 真的需要修改 找到#include <mysql/mysql.h> 把他该为你实际路径” 的,做过实验的,不要吵了/
| cqfanli 回复于:2003-07-24 00:52:02
| 我也成功的做出来了,不过有一个问题!
就是ftp client是list时,系统并不报告它使用了多少空间,还剩多少空间呀?
| wolf1980 回复于:2003-07-24 22:32:03
| 各位前辈,make时提示如下错误。是为什么呀??
modules/mod_quotatab_sql.o: In function `sqltab_create':
modules/mod_quotatab_sql.o(.text+0x265): undefined reference to `quotatab_log'
modules/mod_quotatab_sql.o: In function `sqltab_lookup':
modules/mod_quotatab_sql.o(.text+0x36d): undefined reference to `quotatab_log'
modules/mod_quotatab_sql.o(.text+0x3b8): undefined reference to `quotatab_log'
modules/mod_quotatab_sqlo: In function `sqltab_write':
modules/mod_quotatab_sql.o(.text+0x961): undefined reference to `quotatab_log'
modules/mod_quotatab_sql.o: In function `sqltab_open':
modules/mod_quotatab_sql.o(.text+0xad1): undefined reference to `quotatab_log'
modules/mod_quotatab_sql.o: In function `sqltab_init':
modules/mod_quotatab_sql.o(.text+0xc87): undefined reference to `quotatab_register'
collect2: ld returned 1 exit status
make: *** [proftpd] Error 1
[root@xujj proftpd-1.2.7]#
| feiyi 回复于:2003-08-10 18:46:21
| 我的mysql是用的rpm包安装的,找不到/mysql/include/mysql这个,我应该怎么做呢?
我这里就不知道应该怎么配置了呢?,那位兄弟可以帮帮忙,谢谢您了!
./configure --prefix=/usr/local/proftpd \
--with-modules=mod_sql:mod_sql_mysql \
--with-includes=/usr/local/mysql/include/mysql \
--with-libraries=/usr/local/mysql/lib/mysql
make
make install
| zhangweibo 回复于:2003-08-28 17:23:32
| 不行呀!!!!
[root@bak root]# groupadd -g 1000 -r FTPGRP
groupadd: FTPGRP is a not a valid group name
| golden76 回复于:2003-09-06 01:29:39
| 顶,还是PROFTPD好。
| xanswer 回复于:2003-09-16 18:03:21
| /usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [proftpd] Error 1
我进展到marke这一步提示这个
| Linux@初学者 回复于:2004-05-21 20:20:33
| [root@server root]#/usr/programs/proftp/sbin/proftpd
- Fatal: unknown configuration directive 'bytes_out_avail,' on line 73 of '/usr/programs/proftp/etc/proftpd.conf'.
怎么回事啊?谢谢!
| Linux@初学者 回复于:2004-05-21 20:59:13
| [root@server root]#ftp 10.0.3.40
Connected to 10.0.3.40.
421 Service not available, remote server has closed connection.
| Linux@初学者 回复于:2004-05-21 21:55:32
| [root@server ftp]#ftp 10.0.3.40
Connected to 10.0.3.40.
220 server FTP server ready
Name (10.0.3.40:root): user1
421 Service not available, remote server has closed connection.
ftp: Login failed.
ftp>
怎么回事啊?谢谢!
| hayes 回复于:2004-07-07 19:14:01
| :evil:
晕死了,到make时出错
./configure --prefix=/usr/local/proftpd --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql --with-includes=/usr/local/mysql/include/mysql/ --with-libraries=/usr/local/mysql/lib/mysql/
make
出错了,出错信息如下:
make[1]: Leaving directory `/root/hayes/proftpd-1.2.9/lib/libcap'
gcc -Llib -o proftpd src/main.o src/timers.o src/sets.o src/pool.o src/regexp.o src/dirtree.o src/support.o src/netaddr.o src/inet.o src/log.o src/bindings.o src/scoreboard.o src/feat.o src/netio.o src/response.o src/ident.o src/data.o src/modules.o src/auth.o src/fsio.o src/mkhome.o modules/mod_core.o modules/mod_xfer.o modules/mod_auth_unix.o modules/mod_auth_file.o modules/mod_auth.o modules/mod_ls.o modules/mod_log.o modules/mod_site.o modules/mod_cap.o modules/mod_auth_pam.o modules/mod_quotatab_sql.o modules/mod_quotatab.o modules/mod_sql_mysql.o modules/mod_sql.o modules/module_glue.o -lsupp -lcrypt -Llib/libcap -lcap -lm -lz -lmysqlclient -lpam -L/usr/local/mysql/lib/mysql
modules/mod_quotatab_sql.o: In function `sqltab_create':
modules/mod_quotatab_sql.o(.text+0x24d): undefined reference to `call_module_cmd'
modules/mod_quotatab_sql.o: In function `sqltab_lookup':
modules/mod_quotatab_sql.o(.text+0x362): undefined reference to `call_module_cmd'
modules/mod_quotatab_sql.o: In function `sqltab_write':
modules/mod_quotatab_sql.o(.text+0x919): undefined reference to `call_module_cmd'
collect2: ld returned 1 exit status
make: *** [proftpd] Error 1
有谁知道怎么做?
| hayes 回复于:2004-07-08 11:21:30
| 我已解决了,是版本问题
但启动时又出问题了
[root]#usr/local/proftpd/sbin/proftpd
/usr/local/proftpd/sbin/proftpd: error while loading shared libraries: libmysqlclient.so.10: cannot open shared object file: No such file or directory
| hayes 回复于:2004-07-08 14:00:29
| [root]#usr/local/proftpd/sbin/proftpd
可以了,我copy一个 libmysqlclient.so.10 到 /ur/lib下了
但现在proftpd起动,用前面的测试帐号登录不了,在测试密码时就停了???????????
| cswain 回复于:2004-07-19 17:42:54
| C:\>ftp 192.168.0.161
Connected to 192.168.0.161.
Connection closed by remote host.
就这么快就关闭了,连个提示信息都没有,真不知道什么地方出现问题了。
| adrianmak 回复于:2004-09-06 16:22:16
| 目錄權限怎樣設置?
如同一目錄,不同帳戶有不同權限
|
|
原文转自:http://www.ltesting.net
|
|