各参数注释

User:用户名

status:状态 1为激活状态 0为非激活状态

Password :密码

Uid:用户系统ID号

GID:用户组ID号

ULBandwidth :上传最大带宽 单位 KB/S

DLBandwidth:下载最大带宽 单位 KB/S

comment :注释

ipaccess :允许访问IP地址

QuotaSize :磁盘配额总大小 单位MB

QuotaFiles :允许存放的文件数目个数 0为不限制

关掉进程

killall pure-ftpd

启动服务

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

为ftp添加用户

USE pureftpd;

INSERT INTO `ftpd` (`User`, `status`, `Password`, `Uid`, `Gid`, `Dir`, `ULBandwidth`, `DLBandwidth`, `comment`, `ipaccess`, `QuotaSize`, `QuotaFiles`) VALUES (‘test’, ’1′, MD5(‘test’), ’60031′, ’60031′, ‘/home/test’, ’128′, ’56′, ”, ‘*’, ’100′, ’0′);

即可用数据库里的用户和密码登陆ftp

将pureftpd加载为系统服务

vi /etc/init.d/pureftpd

录入

  1. #!/bin/bash  
  2.  
  3. # chkconfig: 35 95 1  
  4.  
  5. # description: script to start/stop pureftpd  

case $1 in

start)

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

;;

stop)

killall pure-ftpd

;;

*)

echo “Usage: $0 (start|stop)”

;;

esac

更改权限

# chmod 775 pureftpd

加入自动启动

# chkconfig –add pureftpd

查看自动启动设置

# chkconfig –list pureftpd

pureftpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off

以后可以用以下命令启动和停止脚本

# service pureftpd start 启动

# service pureftpd stop 停止

启动和停止mysql服务

#service mysql start

#service mysql stop

若无法上传文件,设置ftp文件夹权限

chmod -R 777 /data0/htdocs

通过文章的介绍和分析,我们可以清楚的知道利用Pureftpd 和 mysql 架设FTP服务器的详细过程。希望本文对大家有所帮助!


相关内容