啥也没写
分类: LINUX
2009-09-23 09:33:14
(建立pureftp的配置文件目录)
mkdir /etc/pureftpd
tar xvf pure-ftpd-1.0.21.tar.bz2
cd pure-ftpd-1.0.21
./configure --prefix=/usr/local/pureftpd \
--with-mysql=/usr/local/mysql \
--with-quotas \
--with-cookie \
--with-virtualhosts \
--with-virtualroot \
--with-diraliases \
--with-sysquotas \
--with-ratios \
--with-ftpwho \
--with-altlog \
--with-paranoidmsg \
--with-shadow \
--with-welcomemsg \
--with-throttling \
--with-uploadscript \
--with-pam \
--with-largefile \
--with-peruserlimits \
--without-bonjour \
--with-cork \
--with-sendfile \
--with-privsep \
--with-capabilities \
--with-language=simplified-chinese \
make
make install
cd configuration-file/
chmod u+x pure-config.pl
cp pure-config.pl /usr/local/pureftpd/sbin/
cp pure-ftpd.conf /etc/pureftpd/
从网上下载pureftpd_php_manage,如果找不到,单击可以加我QQ,问我要,注明“龙族”
上传到/var/www/blog/
编辑pureftp.config.php
设置$PUREFTP_CONFIG_FILE = '/etc/pure-ftpd/db/pureftpd.conf';
为 $PUREFTP_CONFIG_FILE = '/etc/pureftpd/pure-ftpd.conf';
设置$FTP_WHO = "/usr/local/sbin/pure-ftpwho";
为$FTP_WHO = "/usr/local/pureftpd/sbin/pure-ftpwho";
设置 $DefaultUid = "ftpd"; 为你要存放用户的目录的所有者的ID或者用户名
$DefaultGid = "ftpd"; 为你要存放用户的目录的组的GID或者组名
这里主要的主要的是,这个UID和GID必须为发布apache或者nginix的后台运行的拥有者
我为这个问题查询了2天2夜,自己琢磨出来的,例如上面我设置的是www账号运行nginix
我们这样设置
usermod -g ftp www
这句话的意思是把WWW放到ftp组里面去
同时要这样设置 chmod 775 /要设置的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(12 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;
建立PUREFTP 登录日志
1)建立文件/var/log/pureftpd.log
2)修改/etc/syslog.conf
1>在这行的cron.none后面添加 ;ftp.none 使ftp的日志信息成私有
*.info;mail.none;authpriv.none;cron.none /var/log/messages
为
*.info;mail.none;authpriv.none;cron.none;ftp.none /var/log/messages
2>在/etc/syslog.conf文件最后加上
#pureftp日志
ftp.* -/var/log/pureftpd.log
注意: 不要去掉/var前面的-号,否则日志会在/var/log/messages与/var/log/purefpd.log里各记录一份. 添加了-号,就只会记录在/var/log/purefptd.log内
3)使/etc/syslog.conf生效
service syslog restart
到现在设置完毕,重启下pure-ftpd,现在在客户端登陆ftp试下
=============[附我的syslog.conf]==========================
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none;ftp.none /var/log/messages
# The authpriv file has restricted access.
authpriv.* /var/log/secure
# Log all the mail messages in one place.
mail.* -/var/log/maillog
# Log cron stuff
cron.* /var/log/cron
# Everybody gets emergency messages
*.emerg *
# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler
# Save boot messages also to boot.log
local7.* /var/log/boot.log
#pureftp日志
ftp.* -/var/log/pureftpd.log