Combine ProFtpd with Mysql to implement FTP service _ MySQL
Source: Internet
Author: User
1. obtain the installation package. Currently, the latest version of proftpd is 1.2.5rc2. then download a related mod_ SQL package, which can be downloaded here. 2. Compile and install the proftpd source code package decompressed to a temporary directory: tarjxvfproftpd-1.2.5rc2.tar.bz2 and then enter the proftpd-1.2.5rc2contrib decompress mod_sql4.08 version, overwrite the old version, get the installation package
Currently, the latest version of proftpd is 1.2.5rc2. then download a related mod_ SQL package.
This can be downloaded here. 2. Compile and install
Decompress the proftpd source code package to a temporary directory:
Tar jxvf proftpd-1.2.5rc2.tar.bz2
Then enter the proftpd-1.2.5rc2/contrib decompress mod_ SQL 4.08 version, overwrite the old version:
Tar zxvf mod_sql-4.08.tar.gz
Execute the configure configurator in the proftpd-1.2.5rc2 Directory
. /Configure -- prefix =/usr/local/-- with-modules = mod_ SQL: mod_ SQL _mysql -- with-nodes des =/usr/include/mysql -- with-libraries =/usr/lib/mysql
Note: the Mysql path I wrote in the last two sentences refers to the default mysql path in redhat7.3. you can go to the package management page to view the related mysql path.
Make
Make install
3. configuration file:
The following two sentences mean to back up proftpd. conf first, and then copy the default proftpd configuration file in mod_ SQL to the proftpd configuration file directory.
Mv/usr/local/etc/proftpd. conf/usr/local/etc/proftpd. bak
Cp contrib/mod_ SQL .conf/usr/local/etc/proftpd. conf
Modify the following content in the configuration file/usr/local/etc/proftpd. conf:
Modify
SQLConnectInfo dbname @ host: port username password
The connection parameters of your database.
Set
SQLUserInfo users username password uid gid NULL
Change
SQLUserInfo users userid passwd uid gid homedir shell
This is the table name and field name of the FTP account.
In
SQLDefaultHomedir "/tmp"
Add the "#" annotator to the beginning of the line.
Set
# SQLGroupInfo groups groupname gid members
Remove the comment in front of "#". This is the group information. If you do not need anonymous logon, set
To
Before the content.
Find "Group nogroup"
Change to "Group nobody"
4. create a database
In the dbname database in step 3, run the following command to create the corresponding data TABLE and create an account: drop table if exists 'groupup ';
Create table 'groupup '(
'Groupname' varchar (255) binary not null default '',
'Gid' int (11) not null default '0 ',
'Members 'text not null,
Primary key ('groupname ')
) TYPE = MyISAM; insert into 'groups' VALUES ('ftpgroup', 10000, 'ftpuser'); drop table if exists 'users ';
Create table 'users '(
'Userid' varchar (255) binary not null default '',
'Passwd' varchar (255) binary not null default '',
'Uid' int (11) default NULL,
'Gid' int (11) default NULL,
'Homedir' varchar (255) default NULL,
'Shell' varchar (255) default NULL,
'Count' int (11) default NULL,
Primary key ('userid ')
) TYPE = MyISAM; insert into 'users' VALUES ('ftpuser', password ('ftpuser'), 10000,100 00, '/home/ftpuser','/bin/Bash ', 0); 5. start proftpd
[Root @ test/root] #/usr/local/sbin/proftpd start
You can also
Cd/etc/rc. d/rc3.d
Ln-s/usr/local/sbin/proftpd S99proftpd or
Modify/etc/rc. d/rc. local
Add the following sentence
/Usr/local/sbin/proftpd start
This can be automatically loaded at system startup.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.