pure-ftpd

软件列表:

pure-ftpd pureadmin apache mysql php

实现功能:通过web管理ftp用户,实现新增、删除、密码修改、上传/下载限速、磁盘配额、文件数量等功能

通过yum安装apache mysql 和 php 服务程序

shell> yum install httpd mysql mysql-server php php-gd php-mbstring php-mysql mysql-devel

shell> yum groupinstall "Development Libraries" "Development Tools" "X Software Development"

"Legacy Software Development" #安装编译环境

shell> tar -zxvf pure-ftpd-1.0.36.tar.gz -C /usr/local/src/

shell> cd /usr/local/src/pure-ftpd-1.0.36/

shell>./configure --prefix=/usr/local/pureftpd \

> --with-mysql \

> --with-shadow \

> --with-pam \

> --with-welcomemsg \

> --with-uploadscript \

> --with-cookie \

> --with-virtualhosts \

> --with-virtualchroot \

> --with-diraliases \

> --with-quotas \

> --with-puredb \

> --with-sysquotas \

> --with-ratios \

> --with-ftpwho \

> --with-throttling \

> --with-language=simplified-chinese \

shell> make && make install

[root@localhost pure-ftpd-1.0.36]# cd configuration-file/

[root@localhost configuration-file]# chmod a+x pure-config.pl

[root@localhost configuration-file]# cp pure-config.pl /usr/local/pureftpd/sbin

[root@localhost configuration-file]# cp pure-ftpd.conf /usr/local/pureftpd/etc

[root@localhost configuration-file]# cd ../contrib/

[root@localhost contrib]# chmod a+x redhat.init

[root@localhost contrib]# cp redhat.init /etc/init.d/pureftpd

[root@localhost contrib]# vim /etc/init.d/pureftpd

18 fullpath=/usr/local/pureftpd/sbin/$prog

19 pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho

24 $fullpath /usr/local/pureftpd/etc/pure-ftpd.conf --daemonize

#修改启动服务指定的文件路径

1:编写sql文件在mysql中创建一个ftp账号和ftpusers数据库及后台管理账号admin

104947716.png

[root@localhost pureftp]# mysql -u root -p <pureftp.sql #导入数据库文件

Enter password:

mysql> grant all privileges on ftpusers.* to ftp@localhost identified by 'tmppasswd';

Query OK, 0 rows affected (0.00 sec) (进入mysql进行授权)

2:web方式管理

[root@localhost pureftp]# tar -zxvf PureAdmin-0.3.tar.gz -C /var/www/html

[root@localhost pureftp]# cd /var/www/html

[root@localhost html]# mv PureAdmin-0.3/ ./pureadmin

[root@localhost html]# cd pureadmin/

[root@localhost pureadmin]# vim config.php (编辑链接数据库的文件)

105523733.png

2.1编辑pureftpd的主配置文档指定mysql配置文件的位置和DB库文件位置并锁定用户目录

[root@localhost ~]# vim /usr/local/pureftpd/etc/pure-ftpd.conf

191506677.png

192715971.png

[root@localhost pureftp]# cp pureftpd-mysql.conf /usr/local/pureftpd/etc/

设置pureftpd与mysql的链接

[root@localhost ~]# vim /usr/local/pureftpd/etc/pureftpd-mysql.conf

192219549.png

2.2通过web界面建立一个ftpusers数据库的虚拟账号

185916906.png

2.3添加本地与虚拟账号的映射

[root@localhost ~]# useradd virtualftp -d /ftproot -s /sbin/nologin -M

[root@localhost ~]# chown virtualftp:virtualftp /ftproot/

[root@localhost ~]# /usr/local/pureftpd/bin/pure-pw useradd user10 -u virtualftp -g virtualftp -d /ftproot/user10 -m

[root@localhost ~]# /usr/local/pureftpd/bin/pure-pw mkdb pureftpd.pdb

3:测试

194249416.png



你可能感兴趣的:(Pure-FTPd)