Comments on ISPConfig 3 ProFTPd For Debian
ISPConfig 3 ProFTPd For Debian This is a simple tutorial to configure ISPConfig to work with ProFTPd instead of PureFTPd on Debian. Please note that this tutorial does not include quota support.
3 Comment(s)
Comments
Hi ! and thanks for that howto
(Sorry for my english.)
Just to add 2 things :
I'm on debian 7 wheezy and ISPconfig 3.0.5.3
I cant use .ftpacces to protect a folder from ftp user, so i what to switch to proftpd.
There is 2 things that i have to modify to make proftp work with ISPconfig :
1 - In Database Configuration
The SQL query :
Find "TYPE=MyISAM"
To "ENGINE=MyISAM"
2 - In /etc/proftpd/sql.conf
Find :
SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser
To :
SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE username='%u'" ftp_user
And it's work for me
By :)
sql.conf:SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE username='%u'" ftp_user
sql.conf:SQLNamedQuery modified UPDATE "modified=now() WHERE username='%u'" ftp_user
Change for Point 4.
You must create an Table in "DBISPCONFIG" Database with MySQL Events
DROP TABLE IF EXISTS `ftp_group`;
CREATE TABLE IF NOT EXISTS `ftp_group` (
`groupname` varchar(16) NOT NULL DEFAULT '',
`gid` smallint(6) NOT NULL DEFAULT '2001',
`members` varchar(16) NOT NULL DEFAULT '',
UNIQUE KEY `groupname_2` (`groupname`,`gid`,`members`),
KEY `groupname` (`groupname`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DELIMITER $$
DROP EVENT `ftp-group`$$
CREATE DEFINER=`root`@`localhost` EVENT `ftp-group` ON SCHEDULE EVERY 1 HOUR STARTS CURRENT ON COMPLETION NOT PRESERVE ENABLE DO
INSERT INTO `ftp_group`(`groupname`, `gid`, `members`) SELECT 'ftpgroup',2001,ftp_user.uid FROM `ftp_user`$$
DELIMITER ;
you must extend the table "ftp_user" in "DBISPCONFIG" Database
alter table ftp_user add nuid int after gid;3. Change the SQL.CONF to this one
alter table ftp_user add ngid int after nuid;
#
# Proftpd sample configuration for SQL-based authentication.
#
# (This is not to be used if you prefer a PAM-based SQL authentication)
#
</ifmodule mod_sql.c="">
DefaultRoot ~
SQLBackend mysql
# The passwords in MySQL are encrypted using CRYPT
SQLAuthTypes Plaintext Crypt
SQLAuthenticate users groups
# used to connect to the database
# databasename@host 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. Match the names with those in the db
SQLUserInfo ftp_user username password nuid ngid dir shell
SQLUserWhereClause "active = 'y' AND server_id = '1'"
# Here we tell ProFTPd the names of the database columns in the "grouptable"
# we want it to interact with. Again the names match with those in the db
SQLGroupInfo ftp_group groupname gid members
# set min UID and GID - otherwise these are 999 each
SQLMinID 100
# create a user's home directory on demand if it doesn't exist
CreateHome off
RootLogin off
RequireValidShell off
</ifmodule>
Be sure to change _insertpasswordhere_ to the password you retrieved from ISPConfig.
If your MySQL database is on another server, change localhost to represent your MySQL server.
6 ISPConfig 3 Changes
Edit /usr/local/ispconfig/interface/web/sites/ftp_user_edit.php
nano /usr/local/ispconfig/interface/web/sites/ftp_user_edit.php
Find every:
$uid = $web["system_user"]; $gid = $web["system_group"];
Replace with:
$userinfo = posix_getpwnam($web["system_user"]); $uid = $web["system_user"]; $gid = $web["system_group"]; $nuid = $userinfo['uid']; $ngid = $userinfo['gid'];
Note: if you are currently logged into ISPConfig's web panel you have to log out before
changes
Find every:
$sql = "UPDATE ftp_user SET server_id = $server_id, dir = '$dir', uid = '$uid', gid = '$gid', sys_groupid = '$sys_groupid' WHERE ftp_user_id = ".$this->id;
Replace with:
$sql = "UPDATE ftp_user SET server_id = $server_id, dir = '$dir', uid = '$uid', gid = '$gid', nuid = '$nuid', ngid = '$ngid', sys_groupid = '$sys_groupid' WHERE ftp_user_id = ".$this->id;
Last STEPS:
You must an manually the uid and gid into the nuid and ngid.
Example:
User: web107 have uid -> 5013
Group: client25 habe gid -> 5012
then is the nuid = 5013 and ngid = 5012