pureftpd+mysql+quota+pureftpd_php_manager实例安装

由 nicosoft 在 06-12-2003 01:44 发表:

pureftpd+mysql+quota+pureftpd_php_manager实例安装

最近在做个免费申请主页系统,apache+php+mysql+ftpd

一开始用proftpd,但是感觉不是很理想,所以就改成了

pureftpd。看到现在pureftpd的安装文档不多,故将配置

的基本过程写下,以供同好。

需要的软件

pure-ftpd-1.0.15.tar.gz

pureftpd_php_manager.zip

(当然您的系统中要有apache php mysql)

全面设置

#./configure \

--prefix=/usr/local/pureftpd \

--with-mysql=/usr/local/mysql \

--with-paranoidmsg \

--with-shadow \

--with-welcomemsg \

--with-uploadscript \

--with-quotas \

--with-cookie \

--with-pam \

--with-virtualhosts \

--with-virtualroot \

--with-diraliases \

--with-sysquotas \

--with-ratios \

--with-ftpwho \

--with-throttling

简化设置

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

#./configure \

--prefix=/usr/local/pureftpd \

--with-mysql=/usr/local/mysql/ \

--with-diraliases \

--with-ftpwho \

--with-throttling \

--without-inetd \

--without-shadow \

--with-quotas

#make

#make check

#make install

#chmod u+x pure-config.pl

#cp pure-config.pl /usr/local/sbin/

#cp pure-ftpd.conf /usr/local/etc/

按你的需要编辑pure-ftpd.conf

#unzip pureftpd_php_manager.zip

#cd pureftpd_php_manager

#mv pureftpd-mysql.conf.sample /usr/local/etc/pureftpd-mysql.conf

vcd ..

#cp -R pureftpd_php_manager /var/wwwroot/html/pureftpd_php_manager

#cd /var/wwwroot/html/pureftpd_php_manager

#vi pureftp.config.php

#pw groupadd ftpusers

#pw useradd ftpusers -g ftpusers

按照你的需要修改里面的设置

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

######################

####### SETUP ########

######################

// 设置pureftpd-mysql.conf的位置,这个要注意,不要写错哦

$PUREFTP_CONFIG_FILE = '/usr/local/etc/pureftpd-mysql.conf';

// The location where all the Forms directed to. (Mayby no change needed)

$SELF_URL = 'index.php';

// The location of your pure-ftpdwho binary (set this to chmod 4711)

$FTP_WHO = "/usr/local/sbin/pure-ftpwho";

#######################

DEFAULT NEW-USER PARAMS

#######################

$DefaultUser = "ftpuser"; # 默认用户

$DefaultPass = "passwd"; # 默认初始用户密码

$DefaultUid = "2002"; # 默认的uid(设置为ftpusers的uid)

$DefaultGid = "2002"; # 默认的gid(设置为ftpusers的gid)

$DefaultDir = "/var/ftproot/ftpusershome"; # 默认的用户主目录

$DefaultUL = "0"; # 默认用户上传速率限制(KB/S)

$DefaultDL = "0"; # 默认用户下载速率限制(KB/S)

$Defaultip = "*"; # 设置用户可以从哪些IP登陆

$DefaultQS = "50"; # 用户默认的quota

$Defaultcmt = ""; # 默认备注信息

$DefaultQF = "0"; # 默认文件数目quota

$PWC = "55"; # Vorsatz fuerr Crypt Password

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

删除多余的东西

rm -f history.txt pureftpd-mysql.conf.sample

如果要投入真实的使用,最好用apache做身份验证!

在mysql中添加FTP用户数据库

mysql>DROP TABLE IF EXISTS ftpd;

CREATE TABLE ftpd (

User varchar(16) NOT NULL default '',

status enum('0','1') NOT NULL default '0',

Password varchar(64) NOT NULL default '',

Uid varchar(11) NOT NULL default '-1',

Gid varchar(11) NOT NULL default '-1',

Dir varchar(128) NOT NULL default '',

ULBandwidth smallint(5) NOT NULL default '0',

DLBandwidth smallint(5) NOT NULL default '0',

comment tinytext NOT NULL,

ipaccess varchar(15) NOT NULL default '*',

QuotaSize smallint(5) NOT NULL default '0',

QuotaFiles int(11) NOT NULL default 0,

PRIMARY KEY (User),

UNIQUE KEY User (User)

) TYPE=MyISAM;

mysql>grant all on ftpd.* to pureftpd@localhost identified by 'yourpassword'

编辑/usr/local/etc/pureftpd-mysql.conf

将刚才在mysql中新建的用户和密码加入其中,选项很简单,只要注意不要输错

启动

#/usr/local/sbin/pure-config.pl /usr/local/etc/pure-ftpd.conf

然后测试 http://ip/pureftpd_php_manager/index.php

添加一个用户,然后用FTP客户端登陆试试,ok!

常见错误:

Q:用户不能验证,登陆时老是显示验证失败

A:你的pureftpd-mysql.conf里面的用户名字和密码,数据库的名称,字段的名称都对了么?一定要

保证都填对了!还有就是确认用户的主目录存在,并且有访问的权限,最后就是用户的状态是active

么?

Q:用户登陆的不能读写文件

A:确认用户对其主目录具有读写的权限

Q:quota不起作用

A:确保用户的.ftpquota文件权限正确


yes~!


由 nicosoft 在 06-13-2003 08:38 发表:


实现口令的md5加密

编辑你的pureftpd-mysql.conf

将MYSQLCrypt的方法改成md5,如下

MYSQLCrypt md5

然后将mysql里ftp用户的密码都用md5加密

例如如果你的密码是"mypassword",在命令行下就可以

#mail# md5 -s mypassword

MD5 ("mypassword")

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