Software environment:
Pure-ftpd-1.0.36.tar.gz (pure-ftp)
PureAdmin-0.3.tar.gz (web management)
Pureftp. SQL (virtual account database import file)
Pureftpd-mysql.conf (Virtual Account linked Database profile)
1. Install Pure-ftp server
# Wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.36.tar.gz
# Tar-zxvf pure-ftpd-1.0.36.tar.gz-C/usr/local/src/
# Cd/usr/local/src/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
# Make & make install
Copy the master configuration file and service script generated for the pureftp service:
# Chmod a + x configuration-file/pure-config.pl
# Cp configuration-file/pure-config.pl/usr/local/pureftpd/sbin/
# Mkdir/usr/local/pureftpd/etc
# Cp configuration-file/pure-ftpd.conf/usr/local/pureftpd/etc/
Copy and generate the startup script for the pureftp service, and edit and modify the corresponding parameters:
# Cp contrib/redhat. init/etc/init. d/pureftpd
# Vim/etc/init. d/pureftpd
# Chmod 755/etc/init. d/pureftpd
# Chkconfig -- add pureftpd
# Chkconfig pureftpd on
Configure the pure-ftp master configuration file and add the login environment parameters of the virtual account:
# Vim/usr/local/pureftpd/etc/pure-ftpd.conf
Create a user's home directory:
# Mkdir/data/resources/ftpdata
# Chmod-R 777/data/resources/ftpdata/
# Useradd virtualftp-d/data/resources/ftpdata/-s/sbin/nologin-M
# Chown virtualftp. virtualftp/data/resources/ftpdata/
Authentication configuration for virtual accounts:
# Vim/usr/local/pureftpd/etc/pure-ftpd.conf
Create a ing between the virtual account and the local account on the server:
# Cd/usr/local/pureftpd/bin/
#./Pure-pw useradd user1-u virtualftp-g virtualftp-d/data/resources/ftpdata/user1-m
Note:
User1 is the user name,-u virtualftp is the actual linux user,-d specifies the starting directory, and is locked in this directory. If not locked, use-D. If you need different permissions, you can create a new linux user and group. If you use the ftp user that comes with the system, in this case, you also need to modify the MinUID in the configuration file pure-ftpd.conf to the UID 14 of the ftp user, otherwise the 530 error will occur during login; so it is recommended to create another non-system built-in user for ING.
Create a user database:
#./Pure-pw mkdb/usr/local/pureftpd/pureftpf. pdb
II. Install PureAdmin web management
# Tar-zxvf PureAdmin-0.3.tar.gz
# Music PureAdmin-0.3/var/www/html/pureadmin
Import the data file pureftp. SQL to the MySQL database. Because MYSQL 5.1 and later versions are used in the mini series, the PureAdmin table structure engine is not fully compatible and needs to be modified.
Note: make the following changes before import.
Insert into mysql. user (Host, User, Password, Select_priv, primary, Update_priv, Delete_priv, Create_priv, Drop_priv, primary, File_priv, Grant_priv, primary, Index_priv, Alter_priv, primary, x509_subject) VALUES ('localhost', 'ftp ', PASSWORD ('passwd'), 'y', 'n ', 'N', 'n', Y ', 'Y', 'y ');
Flush privileges;
Create database ftpusers;
USE ftpusers;
Create table admin (
Username varchar (35) not null default '',
Password char (32) binary not null default '',
Primary key (Username)
);
Insert into admin VALUES ('admin', MD5 ('20140901 '));
Create table 'users '(
'User' varchar (16) not null default '',
'Password' varchar (32) binary not null default '',
'Uid' int (11) not null default '14 ',
'Gid' int (11) not null default '5 ',
'Dir' varchar (128) not null default '',
'Quotafiles' int (10) not null default '123 ',
'Quotasize 'Int (10) not null default '30 ',
'Ulbandwidth' int (10) not null default '80 ',
'Dlbandwidth' int (10) not null default '80 ',
'Ipaddress' varchar (15) not null default '*',
'Comment' tinytext,
'Status' enum ('0', '1') not null default '1 ',
'Ulratio 'smallint (5) not null default '1 ',
'Dlatio 'smallint (5) not null default '1 ',
Primary key ('user '),
Unique key 'user' ('user ')
);
Import data and authorize:
#/Etc/init. d/mysqld start
# Mysql-rroot-p <pureftp. SQL
Mysql> grant all privileges on ftpusers. * to ftp @ localhost identified by 'tmppasswd ';
Mysql> flush privileges;
Mysql> quit
Modify the pureadmin configuration file and database parameters:
# Vim/var/www/html/pureadmin/config. php
Configure the pureftpd-mysql.conf connection database file:
# Cp/usr/local/src/pure-ftpd-1.0.36/usr/local/pureftpd/etc/
# Vim/usr/local/pureftpd/etc/pureftpd-mysql.conf
III. Browser logon test
Http: // 10.163.11.252/pureadmin (username: admin, password: 123456)
Errors:
Error: configure: error: PAM headers not found.
Install yum install pam-devel
Error: configure: error: libmysqlclient is needed for MySQL support
Install mysql: yum-y install mysql-server mysql-devel mysql