在FreeBSD上Proftpd匿名登陆带Mysql验证的Quota磁盘限额
boxifeng 2007-11-25
环境设置:Freebsd6.2\Mysql-1.1.7-beta\Proftpd-1.2.10
之前装过很多版本,编译总出错,后来找到相关资料,现发我的Mysql是自己编译安装,所以得修改名叫"ld.so.conf"的文件:
#find / -name ld.so.conf -print
/usr/compat/linux/etc/ld.so.conf
加上一行:
/usr/local/mysql/lib/mysql [这是Mysql的安装路径]
以下是网上下载路径,1.2.10之前的版本都要加mod-quotatab包加入。
ftp://ftp.proftpd.org/distrib/source/proftpd-1.2.10.tar.gz
下后得重命名加上.tar.gz
编译:
tar zvxf proftpd-1.2.10.tar.gz
cd proftpd-1.2.10
./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 install
运行:
/usr/local/proftpd/sbin/proftpd
查看进程:
pgrep proftpd
杀死进程:
pkill proftpd
终止活跃连接:
/usr/local/proftpd/sbin/ftpshut now
新建管理数据库:
#cd /usr/local/mysql/bin
#./mysql -u root -p
Enter password:******
mysql>create database proftpd;
mysql>Grant select,insert,update,delete,create,drop,index,alter,create temporary tables,lock tables on proftpd.* to proftpd@localhost Identified by "******";
mysql>quit
新建下表:
1.ftpgroups
CREATE TABLE `ftpgroups` (
`groupname` text NOT NULL,
`gid` smallint(6) NOT NULL default '0',
`members` text NOT NULL
) ENGINE=MyISAM;;
插入数据:(系统组,以后会建立)
INSERT INTO `ftpgroups` VALUES ('ftpgrp', 2001, 'ftpusr');
INSERT INTO `ftpgroups` VALUES ('pubusers', 2002, 'ftp');
2.ftpusers
CREATE TABLE `ftpusers` (
`userid` text NOT NULL,
`passwd` text NOT NULL,
`uid` int(11) NOT NULL default '0',
`gid` int(11) NOT NULL default '0',
`homedir` text,
`shell` text
) ENGINE=MyISAM;;