1. 安裝相關軟件 php
#apt-get install apache2 php5 php5-mysql2. 下載ftp_web管理軟件包
#wget http://machiel.generaal.net/files/pureftpd/ftp_v2.1.tar.gz3. 解壓縮及移動
#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的過程當中出現以下圖所示的問題:
解決方法爲: css
#vi /etc/apache2/apache2.conf ServerSignature off #隱藏apache版本 ServerTokens prod ServerName 主機名 #解決以上錯誤8. 經過瀏覽器測試
http://IP/ftp mysql