Use pureftpd to set up an ftp server with web Management in slackware 10.1

Source: Internet
Author: User
Tags socket connect

PureftpdIt is a fast, high-quality, and fully functional ftp server. The most important thing is that it supports setting the Default Client encoding. Pureftpd is very powerful and useful, today we will show you how to use pureftpd to set up an ftp server with web management under slackware 10.1.

1. Modify/usr/local/pureftpd/etc/pureftpd-mysql.conf

You can clean up the pureftpd-mysql.con file and add the following content.

# If you want to use the Socket connect methode comment out

# Lines with MMYSQLServer and MYSQLPort.

# If you want to use the Port methode comment out of the MYSQLSocket line

# MYSQLSocket/var/lib/mysql. sock

MYSQLServer localhost

MYSQLPort 3306

MYSQLUser xxxxxxxxxx

MYSQLPassword xxxxxxxxxx

MYSQLDatabase pureftpd

MYSQLCrypt cleartext

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 ")

In fact, the content of the pureftpd-mysql.conf.sample file is stored after the pureftpd_php_manager.zip is decompressed.

2. Create a database and a table, run the mysql command to enter the database, and then run the following command

Create database pureftpd;

Use pureftpd;

Drop table if exists ftpd;

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;

3. Modify file permissions

Chmod 4711/usr/local/pureftpd/sbin/pure-ftpwho

4. Create users and groups by using the following command

Groupadd virtualftp

Useradd virtualftp-g virtualftp

Usermod/home/ftp-d virtualftp

Chown virtualftp: virtualftp/home/ftp

V,Install WEB Management

1. Move the downloaded pureftpd_php_manager.zip file to/var/www/htdocs. The command is as follows:

Mkdir/var/www/htdocs/ftp

Mv pureftpd_php_manager.zip/var/www/htdocs/ftp/

2. Edit/var/www/htdocs/ftp/pureftp. conf. php.

<1> modify the following statement

$ PUREFTP_CONFIG_FILE = '/etc/pureftpd-mysql.conf ';

Change to the following

$ PUREFTP_CONFIG_FILE = '/usr/local/pureftpd/etc/pureftpd-mysql.conf ';

<2> modify the following statement.

$ FTP_WHO = "/usr/local/sbin/pure-ftpwho ";

Change to the following

$ FTP_WHO = "/usr/local/pureftpd/sbin/pure-ftpwho ";

<3> modify the following two statements:

$ DefaultUid = "wwwrun"; # Default User ID (must be a real user acct)

$ DefaultGid = "wwwadm"; # Default Group ID (must be a real group acct)

Change to the following content:

$ DefaultUid = "virtualftp"; # Default User ID (must be a real user acct)

$ DefaultGid = "virtualftp"; # Default Group ID (must be a real group acct)

Start the FTP server

1. Run the following command to start the server:

1. Run the following command to start the server:

/Usr/local/pureftpd/etc/pure-config.pl/usr/local/pureftpd/etc/pure-ftpd.conf

2. Enable the FTP server to start with the System

You only need to add the above startup command to the/etc/rc. d/rc. local file to enable the FTP server to start with the system.

Add users through WEB interfaces

Enter the server address in the browser, for example, http: // 192.168.0.1/ftp/index. php (because the pureftpd_php_manager is put here)

The following page is displayed:

Figure 1

Click add user to ADD a USER, as shown in figure

Figure 2

After the related information is added, click save below.

All the configurations are complete. Try your server!

From the description and image analysis in the article, we finally learned how to use pureftpd to set up an ftp server with web management under slackware 10.1. Hope it will be useful to you!

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.