Install ISPConfig 3 ProFTPd for Debian

If you are using a VPS server with OpenVZ, unfortunately you cannot run the Pureftpd that comes with ISPConfig by default. The following article will show you how to use ProFTPd to replace Pureftpd easily.

TipsMake.com - For Linux users, ISPConfig 3 is the leading solution in the field of hosting management on open source. It allows managing multiple servers through 1 cpanel control system. If you are using a VPS server with OpenVZ, unfortunately you cannot run the Pureftpd that comes with ISPConfig by default. The following article will show you how to use ProFTPd to replace Pureftpd easily.

Prepare to install

Install ISPConfig 3 ProFTPd for Debian Picture 1Install ISPConfig 3 ProFTPd for Debian Picture 1 ProFTPd is a powerful and simple FTP server for installation and configuration, used by many servers. However, this tutorial does not include quota because it is not supported in VPS (if you do not want to edit ftp_user_edit.php in ISPConfig 3).

In this illustration we use Debian 5.0 Lenny but it can also be applied to version 6.0. Some other distributions may need some modification.

Note: this process works fine on a clean server and installs ISPConfig 3. If using the current server will need to enter and editting / saving every user created, which may cause some problems.

Setting

First, run the following command independently:

apt-get remove pure-ftpd-common pure-ftpd-mysql
apt-get install proftpd proftpd-mod-mysql

Create Group & User

groupadd -g 2001 ftpgroup
useradd -u 2001 -s / bin / false -d / bin / null -c "proftpd user" -g ftpgroup ftpuser

Configure the database

Run the following command:

mysql -u root -p
Use dbispconfig

Then run the following query:

ALTER TABLE `ftp_user` ADD` shell` VARCHAR (18) NOT NULL DEFAULT
'/ sbin / nologin',
ADD `count` INT (11) NOT NULL DEFAULT '0',
ADD `access` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
ADD `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';
CREATE TABLE ftp_group (
groupname varchar (16) NOT NULL default '',
gid smallint (6) NOT NULL default '5500',
members varchar (16) NOT NULL default '',
KEY groupname (groupname)
) TYPE = MyISAM COMMENT = 'ProFTP group table';
INSERT INTO `ftp_group` (` groupname`, `gid`,` members`) VALUES
('ftpgroup', 2001, 'ftpuser');

Configure ProFTPd

We will first modify the /usr/local/ispconfig/interface/lib/config.inc.php file:

nano /usr/local/ispconfig/interface/lib/config.inc.php

Find the variable db_password and password note for later.

Edit the file /etc/proftpd/proftpd.conf :

nano /etc/proftpd/proftpd.conf

Find to line:

#Include /etc/proftpd/sql.conf

Remove the caption for it to become:

Include /etc/proftpd/sql.conf

Edit the file /etc/proftpd/sql.conf :

nano /etc/proftpd/sql.conf

Delete all content in it and replace it with:

 # # Proftpd sample configuration for SQL-based authentication. # # (This không phải được sử dụng nếu bạn muốn xác thực PAM-based) # DefaultRoot ~ SQLBackend mysql # The passwords printed MySQL are encrypted using CRYPT SQLAuthTypes Plaintext Crypt SQLAuthenticate users # used to connect to the database # databasename users group database_user user_password SQLConnectInfo dbispconfig @ localhost ispconfig _insertpasswordhere_ # Here we tell ProFTPd the names of the database columns in the "usertable" # we want it to interact with. Đã có các tên với các người dùng trong cơ sở dữ liệu dbUser trong sqp_user username password uid gid dir shell # Here we tell ProFTPd the names of the database columns in the "grouptable" # we want it to interact with. Again các tên với các cùng trong cơ sở dữ liệu SQLGroupInfo ftp_group groupname gid members # set min UID and GID - otherwise these are 999 each SQLMinID 500 # create a directory user on demand if it doesn't exist CreateHome off # Update count every time logs in SQLLog PASS updatecount SQLNamedQuery updatecount UPDATE "count = count + 1, accessed = now () WHERE userid = '% u'" ftpuser # Update modified everytime user uploads or deletes a file SQLLog STOR, DELE modified SQLNamedQuery modified UPDATE, DELE modified SQLNamedQuery modified UPDATE "modified = now () WHERE userid = '% u' "ftpuser RootLogin off RequireValidShell off 

Make sure you have changed _insertpasswordhere_ with a password from ISPConfig.

If the MySQL database is on another server, change localhost to represent your MySQL server.

Edit the file /etc/proftpd/modules.conf :

nano /etc/proftpd/modules.conf

Find to line:

#LoadModule mod_sql.c

and uncomment it to:

LoadModule mod_sql.c

Change the line:

#LoadModule mod_sql_mysql.c

City:

LoadModule mod_sql_mysql.c

Finally run:

/etc/init.d/proftpd restart

Change ISPConfig 3

Now we need to change some files in ispconfig. Although this is not the best idea because when upgrading to the new version, these changes will disappear. However, in this case, ProFTPD will work better.

Edit the file /usr/local/ispconfig/interface/web/sites/ftp_user_edit.php :

nano /usr/local/ispconfig/interface/web/sites/ftp_user_edit.php

Find the line:

$ uid = $ web ["system_user"];
$ gid = $ web ["system_group"];

and replace with:

$ userinfo = posix_getpwnam ($ web ["system_user"]);
$ uid = $ userinfo ['uid'];
$ gid = $ userinfo ['gid'];

It is done! Note that if you are logged into the ISPConfig web console, you must log out before changing the registrations on your computer.

3.8 ★ | 13 Vote