当前位置: 主页 > 服务器技术 > Ftp服务器 > CentOS5系统中PureFTPd安装教程

CentOS5系统中PureFTPd安装教程

时间:2010-7-6来源:互联网 点击:

     PureFTPd支持虚拟用户带磁盘限额,闲话少说,本文在Centos5环境下安装PureFTPd

     1.下面我们开始安装PureFTPd,同样以FreeBSD的Ports方式安装。

#tar zxfv pure-ftpd-1.0.21.tar.gz -C /usr/local/
#cd /usr/local/pure-ftpd-1.0.21/
#./configure \
--prefix=/usr/local/pureftpd \
--with-mysql \
--with-puredb \
--with-paranoidmsg \
--with-peruserlimits \
--with-shadow \
--with-welcomemsg \
--with-uploadscript \
--with-quotas \
--with-cookie \
--with-pam \
--with-virtualhosts \
--with-virtualroot \
--with-virtualchroot \
--with-diraliases \
--with-sysquotas \
--with-ratios \
--with-ftpwho \
--with-throttling \
--with-largefile \
--with-language=simplified-chinese \
--with-altlog \
--with-iplogging \
--without-usernames
#make
# make check
# make install

下面配置pureftpd:
# mkdir –pv /usr/local/pureftpd/etc
#cp pureftpd-mysql.conf /usr/local/pureftpd/etc
# cp configuration-file/pure-config.pl /usr/local/pureftpd/sbin/ (生成配置文件)
# cp configuration-file/pure-ftpd.conf /usr/local/pureftpd/etc/
# chmod 755 /usr/local/pureftpd/sbin/pure-config.pl

# cd contrib
编辑 redhat.init 文件。找到语句
找到语句: "pureftpwho=/usr/local/sbin/pure-ftpwho",
将其改为: "pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho"
找到语句: ”$fullpath /usr/local/etc/pure-ftpd.conf –daemonize”
将其改为: ”$fullpath /usr/local/pureftpd/etc/pure-ftpd.conf –daemonize”
执行以下命令将文件 redhat.init 复制到 /etc 目录中重命名为 pure-ftpd,并将其设置为可执行。
# cp redhat.init /etc/rc.d/init.d/pureftpd
# chmod u+x /etc/rc.d/init.d/pureftpd

# /sbin/chkconfig --add pureftpd ( 将 pure-ftpd 服务添加到系统中 )
# /sbin/chkconfig –level 2345 pureftpd on
#serv        ice pureftpd start
解释:
注明:)
在README中[ADVANCED COMPILATION]的段落中,有对上面的使用的
      详细说明.在这里对常用的做简略的解释.
      --without-standalone 不能以standalone的方式执行ftpd.
      --without-inetd           不能以inetd的方式执行ftpd.
      --without-iplogging           做log時不将IP 地址给log下來.
      --without-shadow           不做shadow.除非是用PAM, LDAP or SQL.不然极不建议拿掉.
      --without-usernames           文件列表只会列出UID & GID,不列出实际user or group name.
      --without-humor           嘿嘿嘿....
      --without-ascii           不支持7-bits transfers(ASCII).
      --with-paranoidmsg           唔....不知该怎么说.算是可以给特定人的信息吧.
      --with-sysquotas           吃系统的quota设定.
      --with-minimal           最小化安裝.
      --with-pam
      --with-puredb
      --with-ldap
      --with-mysql
      --with-pgsql           以上五种都是存储资料的格式?.看你比较习惯什么.
      --with-altlog           留log了....
      --with-cookie           使用者进站看到的东东.类似进站画面.
      --with-ratios           上下传比.
      --with-throttling           频宽可设限.
      --with-ftpwho           可用pure-ftpwho來看线上使用者.像是Serv-u的线上状态.
      --with-uploadscript   当一个文件被完整上传完后自动呼叫某一script去对这个文件处理.当然.这个script得你自己写.
      --with-largefile           支持下载超过2G的文件.
      --with-virtualhosts           跟http的virtualhost有异曲同工之妙.
      --with-virtualchroot           配合上面的chroot.
      --with-diraliases           跟Serv-U上面的link功能一样.
      --with-nonroot           不需root权限.一般user即可启动ftpd.
      --with-quotas           使用quota.(非系统下的quota)
      --with-peruserlimits         每个账号最多可登入几次:Anonymous最多可同時登入几次
      --with-everything          所有功能全上.
      --with-language=simplified-chinese           显示出来的信息的语言.缺省为英语.

安装完后,就会在/usr/local目录下生成一个pureftpd目录,我们要使用的文件都在这个目录中。

2.下面我们开始配置pure-ftpd.conf文件

在这里我全使用默认值,修改下面内容以支持MYSQL。(注:Pureftpd可以同时支持ldap,mysql,pgsql,puredb认证)

# MySQL configuration file (see README.MySQL)
MySQLConfigFile /usr/local/pureftpd/etc/pureftpd-mysql.conf

修改不然无法执行 #service pureftpd stop)
# If your pure-ftpd has been compiled with standalone support, you can change
# the location of the pid file. The default is /var/run/pure-ftpd.pid
#PIDFile                     /var/run/pure-ftpd.pid
#去掉上面的注释
PIDFile                     /var/run/pure-ftpd.pid
修改不允许名登陆
NoAnonymous                 yes
# Allow FXP transfers for authenticated users.
AllowUserFXP                yes
# Allow users to resume and upload files, but *NOT* to delete them.
KeepAllFiles                yes
# Automatically create home directories if they are missing
CreateHomeDir               yes

ChrootEveryone yes

chroot每一个用户,等同于Proftpd 中的DefaultRoot~ , 可以限制用户在某个地方活动,增强服务器的安全性。使用过wu-ftpd的使用都应该知道cd /会发生什么!

站长资讯网
.
分页: [1] [2]
TAG: Centos5 PureFTPd 安装教程
推荐内容最近更新人气排行
关于我们 | 友情链接 | 网址推荐 | 常用资讯 | 网站地图 | RSS | 留言