先从网站上下载软件包,格式为tar.gz或tar.bz2,以pure-ftpd-1.0.21.tar.gz版本为例.
debian:/# tar -zxvf pure-ftpd-1.0.21.tar.gz #在软件包所在目录下解压软件包.
debian:/# cd pure-ftpd-1.0.21 #进入解压后的目录.
debian:/# ./configure --prefix=/usr/local/pureftpd #指定安装路径.
debian:/# make #编译文件.
debian:/# make install #编译文件后安装.
debian:/# cd /pure-ftpd-1.0.21/configuration-file #进入configuration-file目录
debian:/# cp pure-config.pl /usr/local/pureftpd/sbin/pure-config.pl #复制文件
debian:/# cp pure-ftpd.conf /usr/local/pureftpd/etc/pure-ftpd.conf #复制文件
debian:/# mkdir /etc/rc.boot #新建rc.boot目录
debian:/# touch /etc/rc.boot/pureftpd.sh #新建pureftpd.sh文件
debian:/# cat /etc/rc.boot/pureftpd.sh #添加以下内容.
#!/bin/sh
/usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf
debian:/# chmod 755 /etc/rc.boot/pureftpd.sh #增加文件可执行权限.
debian:/# ln -s /etc/rc.boot/pureftpd.sh /etc/rc2.d/S88pureftpd #加入开机启动.
debian:/# ./etc/rc.boot/pureftpd.sh #执行文件或重启都行!
pure-ftpd日志记录设置/var/log/pureftpd.log
1)建立文件/var/log/pureftpd.log
2)修改/etc/rsyslog.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/rsyslog.conf文件最后加上
#pureftp日志
ftp.* -/var/log/pureftpd.log
注意: 不要去掉/var前面的-号,否则日志会在/var/log/messages与/var/log/purefpd.log里各记录一份. 添加了-号,就只会记录在/var/log/purefptd.log内
3)使/etc/rsyslog.conf生效
[test@ ]# killall -HUP syslogd
到现在设置完毕,重启下pure-ftpd,现在在客户端登陆ftp试下
=============[附我的rsyslog.conf]==========================
#*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none;ftp.none -/var/log/messages
#
# Emergencies are sent to everybody logged in.
#
*.emerg *
#
# I like to have messages displayed on the console, but only on a virtual
# console I usually leave idle.
#
#daemon,mail.*;\
# news.=crit;news.=err;news.=notice;\
# *.=debug;*.=info;\
# *.=notice;*.=warn /dev/tty8
# The named pipe /dev/xconsole is for the `xconsole' utility. To use it,
# you must invoke `xconsole' with the `-file' option:
#
# $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
# busy site..
#
daemon.*;mail.*;\
news.err;\
*.=debug;*.=info;\
*.=notice;*.=warn |/dev/xconsole
#pure-ftpd log
ftp.* -/var/log/pureftpd.log
阅读(1453) | 评论(0) | 转发(0) |