关于用mysql和proftpd结合.谁能看懂这文章?

由 linuxsky 在 05-22-2002 10:27 发表:

关于用mysql和proftpd结合.谁能看懂这文章?

全是英文的

我看起来很吃力..

唉..

=====================================

1. How do I use ProFTPD with mod_sql?

=====================================

The current supported version of mod_sql is distributed with ProFTPD.

Everything in this tarball belongs in the contrib subdirectory of the

ProFTPD source tree:

cd contrib

tar -xzvf mod_sql-3.2.3.tar.gz

To build ProFTPD with mod_sql support, call configure with the

following arguments (for example):

If you're using the MySQL backend:

./configure --with-modules=mod_sql:mod_sql_mysql

If you're using the Postgres backend:

./configure --with-modules=mod_sql:mod_sql_postgres

You will need to tell configure how to find your database-specific

libraries and header files; I use the MySQL backend and call configure

like this:

./configure --with-modules=mod_sql:mod_sql_mysql \

--with-includes=/usr/local/include \

--with-libraries=/usr/local/lib/mysql

Now, read the Directives section below.

===================================================

2. How do I setup my database for use with mod_sql?

===================================================

I'm assuming you know how to use your database system.

At the minimum, mod_sql must be able to access a table with two

columns: userid and passwd. For full functionality, you probably need

to do more, including creating another database table to hold group

information.

In the following table headings, 'COLUMN' is the column name, 'TYPE'

is the datatype expected (text or numeric), 'R' means "required

column", 'N' means "if this column exists, are NULL values

allowed". and 'USE' gives a very brief description of what goes in

there.

USERTABLE: This table MUST exist in the database.

COLUMN TYPE R N USE

---------------------------------------------------------

userid text Y N user's login id

uid num N Y user's uid

gid num N Y user's gid

passwd text Y N user's password

shell text N Y user's shell

homedir** text N Y user's homedir

count num N N login counter

**see the description of the directives SQLHomedir and SQLHomedirField

GROUPTABLE: For full functionality of this module, this table should

exist. If you elect NOT to create it, you MUST set the

'SQLDoGroupAuth' directive to 'OFF'.

COLUMN TYPE R N USE

---------------------------------------------------------

groupname text Y N group's name

gid num Y N group's gid

members text Y Y group's members

Note: multiple members per group must be separated by commas and

should not include whitespace.

Note: mod_sql will concatenate all matching group rows -- that is, you

can have multiple rows for each group with only one member per group,

or you can have a single row with multiple groups, or you can mix and

match.


由 pandonny 在 05-22-2002 10:39 发表:


等北南兄吧,北南兄的E文很棒


关爱社区,共建家园!


由 linuxsky 在 05-23-2002 10:49 发表:


今天用东方快车的全文翻译

看懂了一点


由 linuxsky 在 05-23-2002 10:55 发表:


关于proftpd的关于与mysql结合的全文解释在这里

是英文的

我是不会做了


由 小凡 在 05-23-2002 13:24 发表:


我刚刚做了一个,感觉不错。不知道你有什么问题?


由 小凡 在 05-23-2002 14:07 发表:


我把我安装、配置的过程介绍一下,希望对有此需求的朋友有帮助。

一、得到安装包

proftpd的最新版是1.2.5rc2,下载地址是:

ftp://ftp.proftpd.org/distrib/sourc....2.5rc2.tar.bz2

它自带的mod_sql版本是4.07,有一个漏洞,我们用最新的4.08版,下载地址在:

http://www.lastditcheffort.org/~aah...sql-4.08.tar.gz

二、编译安装

将proftpd的源码包解压缩到某临时目录下:

[root@test /tmp]# tar jxvf proftpd-1.2.5rc2.tar.bz2

进入mod_sql所在目录:

[root@test /tmp]# cd proftpd-1.2.5rc2/contrib/

解压缩mod_sql 4.08版,覆盖老版本:

[root@test /tmp/proftpd-1.2.5rc2/contrib]# tar zxvf mod_sql-4.08.tar.gz

进入proftpd源代码主目录:

[root@test /tmp/proftpd-1.2.5rc2/contrib]# cd ..

执行configure配置程序:

[root@test /tmp/proftpd-1.2.5rc2]# ./configure --prefix=/usr/local/proftpd --with-modules=mod_sql:mod_sql_mysql

编译:

[root@test /tmp/proftpd-1.2.5rc2]# make

安装:

[root@test /tmp/proftpd-1.2.5rc2]# make install

三、配置proftpd

将mod_sql包含的proftpd默认配置文件拷贝到proftpd的配置文件目录中:

[root@test /tmp/proftpd-1.2.5rc2]# mv /usr/local/proftpd/etc/proftpd.conf /usr/local/proftpd/etc/proftpd.conf.BAK

[root@test /tmp/proftpd-1.2.5rc2]# cp contrib/mod_sql.conf /usr/local/proftpd/etc/proftpd.conf

修改配置文件/usr/local/proftpd/etc/proftpd.conf中的以下内容:

修改

SQLConnectInfo dbname@host:port username password

为你的数据库的相应连接参数。

SQLUserInfo users username password uid gid NULL NULL

改为

SQLUserInfo users userid passwd uid gid homedir shell

这是使用FTP帐号的表名和字段名。

SQLDefaultHomedir "/tmp"

的行首加上“#”注释符。

SQLGroupInfo groups groupname gid members

前面的“#”注释符去掉,这是组信息。

如果不需要匿名登录,将

1<anonymous ~ftp="">   
2  
34  
5</anonymous>

之间的内容前都加上“#”注释符。

四、建立数据库

在第三步中的dbname库中用以下命令建立相应的数据表,并建立一个帐号:

DROP TABLE IF EXISTS groups;

CREATE TABLE groups (

groupname varchar(255) binary NOT NULL default '',

gid int(11) NOT NULL default '0',

members text NOT NULL,

PRIMARY KEY (groupname)

) TYPE=MyISAM;

INSERT INTO groups VALUES ('ftpgroup', 10000, 'ftpuser');

DROP TABLE IF EXISTS users;

CREATE TABLE users (

userid varchar(255) binary NOT NULL default '',

passwd varchar(255) binary NOT NULL default '',

uid int(11) default NULL,

gid int(11) default NULL,

homedir varchar(255) default NULL,

shell varchar(255) default NULL,

count int(11) default NULL,

PRIMARY KEY (userid)

) TYPE=MyISAM;

INSERT INTO users VALUES ('ftpuser', password('ftpuser'), 10000, 10000, '/home/ftpuser', '/bin/bash', 0);

五、启动proftpd

[root@test /root]# /usr/local/proftpd/bin/proftpd

OK,试试吧~~~


由 小凡 在 05-23-2002 14:17 发表:


proftpd中关于mod_sql的选项很多,以上只是最基本的选项,所有选项如下,有举的朋友可以仔细研究研究:

SQLAuthenticate

SQLAuthoritative

SQLAuthTypes

SQLConnectInfo

SQLDefaultGID

SQLDefaultHomedir

SQLDefaultUID

SQLDoAuth

SQLDoGroupAuth

SQLEmptyPasswords

SQLEncryptedPasswords

SQLGidField

SQLGroupGIDField

SQLGroupInfo

SQLGroupMembersField

SQLGroupnameField

SQLGroupTable

SQLGroupWhereClause

SQLHomedir

SQLHomedirField

SQLHomedirOnDemand

SQLLog

SQLLogDirs

SQLLogHits

SQLLogHosts

SQLLoginCountField

SQLLogStats

SQLMinID

SQLMinUserGID

SQLMinUserUID

SQLNamedQuery

SQLPasswordField

SQLProcessGrEnt

SQLProcessPwEnt

SQLRatios

SQLRatioStats

SQLScrambledPasswords

SQLShellField

SQLShowInfo

SQLSSLHashedPasswords

SQLUidField

SQLUserInfo

SQLUsernameField

SQLUserTable

SQLUserWhereClause

SQLWhereClause


由 pandonny 在 05-23-2002 16:11 发表:


多谢小凡兄为兄弟们吃螃蟹啦。。。。

这就回去试试!


关爱社区,共建家园!


由 linuxsky 在 05-23-2002 17:41 发表:


出错了..

我在做make这步时出错

cd lib ; make lib

make[1]: Entering directory `/root/proftpd-1.2.5rc2/lib'

make[1]: Nothing to be done for `lib'.

make[1]: Leaving directory `/root/proftpd-1.2.5rc2/lib'

cd src ; make src

make[1]: Entering directory `/root/proftpd-1.2.5rc2/src'

make[1]: Nothing to be done for `src'.

make[1]: Leaving directory `/root/proftpd-

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus