Set up FTP servers for Pureftpd and mysql (1)

Source: Internet
Author: User

PureftpdIt is a fast, high-quality, and fully functional ftp server. The most important thing is that it supports setting the Default Client encoding. Today I will give you a detailed introduction: the specific process of setting up FTP servers in Pureftpd and mysql.

Download the mysql5.1. 31 RPM file and the pure-ftpd source package

Install the mysql5.1.31 shared package

Rpm-ivh MySQL-shared-community-5.1.31-0.rhel5.i386.rpm

Compile and install pure-ftpd

 
 
  1. #./configure –prefix=/usr/local/pureftpd –with-mysql –with-paranoidmsg –with-welcomemsg –with-uploadscript –with-cookie –with-virtualchroot –with-virtualhosts –with-virtualroot –with-diraliases –with-quotas –with-sysquotas –with-ratios –with-ftpwho –with-throttling  
  2.  
  3. #make  
  4.  
  5. #make check  
  6.  
  7. #make install  

Configure pure-ftpd

 
 
  1. #cd configuration-file  
  2.  
  3. #chmod u+x pure-config.pl  
  4.  
  5. #cp pure-config.pl /usr/local/sbin/  
  6.  
  7. #cp pure-ftpd.conf /usr/local/etc/  
  8.  
  9. vi /usr/local/etc/pure-ftpd.conf  

Confirm the following three items

ChrootEveryone yes

MySQLConfigFile/etc/pureftpd-mysql.conf

CreateHomeDir yes

Create mysql Databases and users for puer-ftpd

Create database pureftpd;

Grant select, INSERT, UPDATE, DELETE, CREATE, drop on pureftpd. * TO 'pureftpd '@ 'localhost' identified by 'Password ';

Flush privileges;

USE pureftpd;

Create table ftpd (

User varchar (16) not null default ",

Status enum ('0', '1') not null default '0 ′,

Password varchar (64) not null default ",

Uid varchar (11) not null default '-1 ′,

Gid varchar (11) not null default '-1 ′,

Dir varchar (128) not null default ",

ULBandwidth smallint (5) not null default '0 ′,

DLBandwidth smallint (5) not null default '0 ′,

Comment tinytext not null,

Ipaccess varchar (15) not null default '*',

QuotaSize smallint (5) not null default '0 ′,

QuotaFiles int (11) not null default 0,

Primary key (User ),

Unique key User (User)

) TYPE = MyISAM;

Configure pureftpd-mysql.conf

Vi/etc/pureftpd-mysql.conf

Input

MYSQLSocket/tmp/mysql. sock

# MYSQLServer localhost

# MYSQLPort 3306

MYSQLUser pureftpd

MYSQLPassword password

MYSQLDatabase pureftpd

# MYSQLCrypt md5, cleartext, crypt () or password ()-md5 is very recommendable uppon cleartext

MYSQLCrypt md5

MYSQLGetPW SELECT Password FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")

MYSQLGetUID SELECT Uid FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")

MYSQLGetGID SELECT Gid FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")

MYSQLGetDir SELECT Dir FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")

MySQLGetBandwidthUL SELECT ULBandwidth FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")

MySQLGetBandwidthDL SELECT DLBandwidth FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")

MySQLGetQTASZ SELECT QuotaSize FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")

MySQLGetQTAFS SELECT QuotaFiles FROM ftpd WHERE User = "L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "R ")


Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.