pure-ftp+pureadmin配置及应用

                                               pure-ftp+pureadmin配置及应用

 
本地yum源配置与lamp的搭建不再详述,安装以下rpm包
[root@localhost Server]# yum -y install httpd php mysql mysql-servermysql-devel php-mysql
[root@localhost ~]# service mysqld start
[root@localhost ~]# chkconfig mysqld on
[root@localhost ~]# mysqladmin -u root -p password '123456'
[root@localhost ~]# service httpd start
[root@localhost ~]# chkconfig httpd on
 
上传以下文件
 

安装pure-ftp   
[root@localhost pureftp]# tar -zxvf pure-ftpd-1.0.36.tar.gz -C /usr/local/rsc
[root@localhost pureftp]# cd /usr/local/src/pure-ftpd-1.0.36/
[root@localhost pure-ftpd-1.0.36]#./configure \
      --prefix=/usr/local/pureftpd \
       --with-mysql \
       --with-shadow \
       --with-pam \
        --with-welcomemsg   \
       --with-uploadscript \
       --with-cookie   \
       --with-virtualchroot \
       --with-virtualhosts \
       --with-diraliases \
       --with-quotas \
       --with-puredb \
       --with-sysquotas \
        --with-ratios \
       --with-ftpwho \
      --with-throttling \
      --with-language=simplified-chinese
       --with-pam=/usr/local
 [root@localhost pure-ftpd-1.0.36]# make
 [root@localhost pure-ftpd-1.0.36]# make install
 
 配置启动文件
[root@localhost pure-ftpd-1.0.36]# cd contrib.
[root@localhost contrib]# cp -p redhat.init /etc/init.d/pureftpd
[root@localhost contrib]# chmod a+x /etc/init.d/pureftpd
 配置可执行文件
[root@localhost pure-ftpd-1.0.36]# cd configuration-file/
[root@localhost configuration-file]# cp -p pure-config.pl /usr/local/pureftpd/sbin/
[root@localhost configuration-file]# chmod a+x /usr/local/pureftpd/sbin/pure-config.pl
 设置主配置文件
[root@localhost configuration-file]# mkdir /usr/local/pureftpd/etc/
[root@localhost configuration-file]# cp -p pure-ftpd.conf /usr/local/pureftpd/etc/
 设置启动脚本
[root@localhost ~]# cd /etc/init.d
[root@localhost init.d]# vim pureftpd
 

[root@localhost init.d]# chkconfig --add pureftpd
[root@localhost init.d]# service pureftpd start
[root@localhost init.d]# chkconfig pureftpd on
修改主配置文件
[root@localhost init.d]# cd /usr/local/pureftpd/etc
[root@localhost etc]# vim pure-ftpd.conf //修改以下两行
NoAnonymous                  yes   不允许匿名登录
CreateHomeDir                yes   允许用户登录后自动创建家目录    <必须>
配置虚拟用户登陆环境
[root@localhost ~]# mkdir /ftproot
[root@localhost ~]# chmod 777 /ftproot
[root@localhost ~]# useradd virtualftp -d /ftproot -s /sbin/nologin -M
[root@localhost ~]# chown virtualftp:virtualftp /ftproot
[root@localhost ~]# echo PATH=$PATH:/usr/local/pureftpd/bin/ >>/etc/profile
[root@localhost ~]# source /etc/profile
导入数据库pureftp.sql
[root@localhost pureftp]# vim pureftp.sql //可选
INSERT INTO admin VALUES ('admin',MD5('123'));
[root@localhost pureftp]# mysql -u root -p <pureftp.sql
mysql>grant all privileges on ftpusers.* to ftp@localhost identified by 'tmppasswd';
mysql>flush privileges;
mysql>quit;
修改配置文件
[root@localhost pureftp]# vim /usr/local/pureftpd/etc/pure-ftpd.conf
MySQLConfigFile                /usr/local/pureftpd/etc/pureftpd-mysql.conf //第116行
修改接口文件
[root@localhost pureftp]# cp -p pureftpd-mysql.conf /usr/local/pureftpd/etc/
[root@localhost pureftp]# vim /usr/local/pureftpd/etc/pureftpd-mysql.conf
MYSQLPassword    tmppasswd //第32行
MYSQLCrypt       md5   //第45行
配置Pure-admin
[root@localhost pureftp]# tar -zxvf PureAdmin-0.3.tar.gz -C /var/www/html/
[root@localhost pureftp]# cd /var/www/var/html
[root@localhost html]# mv PureAdmin-0.3 pureadmin //可选
[root@localhost html]# cd pureadmin/
[root@localhost pureadmin]# vim config.php
 
 

测试结果
 

添加用户

 

学而时习之。

你可能感兴趣的:(pureadmin,pure-ftp)