FTP服务器之pure-ftpd实现web管理

1.    安装相关软件

#apt-get  install apache2 php5 php5-mysql
2.    下载ftp_web管理软件包
#wget http://machiel.generaal.net/files/pureftpd/ftp_v2.1.tar.gz
3.    解压缩及移动
#tar zxvf ftp_v2.1.tar.gz 
#mv ./ftp/ /var/www/
4.    配置相关参数
#vi /var/www/ftp/config.php
    $LANG = "Chinese";                  // See the directory language for the available languages.

  $LocationImages =  "images";        // Location of images

  $DBHost = "mysql数据库ip地址";              // Ip-address of MySQL server
                                      // (Don<92>t change this if you are using the default database)

  $DBLogin = "登录mysql账号";                   // Username of MySQL user

  $DBPassword = "登录mysql密码";          // Password of MySQL user

  $DBDatabase = "ftp虚拟账号数据库名";           // Name of database

  $FTPAddress = "pureftp所在服务器ip:21";   // Domain name or ip-address of your ftp server

  $DEFUserID = "你所创建的针对ftp账号的UID"; // nobody     // Default user id of virtual ftp user.

  $DEFGroupID = "你所创建的针对ftp账号的UID";   // guest      // Default group is of virtual ftp user.

  $UsersFile = "/etc/passwd";        // The unix user file

  $GroupFile = "/etc/group";         // The unix group file

  $StyleSheet = "style/default.css.php"; // The location of the style sheet

  $EnableQuota = 1;                  // Enable virtual quota's (0=Off 1=On)
5.    创建admin表
Mysql> use ftpusers;
Mysql>create table if not exists `admin`(
    `username` varchar(35) not null default '',
    `password` char(32) not null default '',
    primary key (`username`)
    )engine=innodb default charset=utf8;
6.    插入一个admin账号
mysql>	insert into `admin` (`username`,`password`) values ('Administrator',MD5('ftppassowrd'));
7.    重启ftp及apache2
#/etc/init.d/pure-ftpd-mysql restart
#/etc/init.d/apache2 restart
        如果在启动apache2的过程中出现如下图所示的问题:

        解决方法为:

#vi /etc/apache2/apache2.conf 
ServerSignature off #隐藏apache版本
ServerTokens prod
ServerName      主机名  #解决以上错误
8.    通过浏览器测试

        http://IP/ftp

你可能感兴趣的:(FTP服务器之pure-ftpd实现web管理)