Virtual Hosting With Proftpd And MySQL (Incl. Quota) - Page 2
|
4 Configure Proftpd Open /etc/proftpd.conf and add the following lines to it:
Make sure that
you replace the string password
with the real password for the MySQL user proftpd
in the line SQLConnectInfo! Restart Proftpd: /etc/init.d/proftpd restart Martin Mrajca has sent me these lines that you can add to /etc/proftpd.conf so that Proftpd sends you a banner with used / available space after LIST:
Don't forget to restart Proftpd afterwards if you add these lines!
5 Populate The Database And Test To populate the database you can use the MySQL shell: mysql -u root -p First we create an entry in the table ftpgroup. It contains the groupname, the groupid and the username of the ftp group/user we created at the end of step two (replace the groupid appropriately if you use another one than 2001): INSERT INTO `ftpgroup` (`groupname`, `gid`, `members`) VALUES ('ftpgroup', 2001, 'ftpuser'); Now we are done with the table ftpgroup. We do not have to create further entries here. Whenever you create a new virtual ftp user, you do this in the tables ftpquotalimits and ftpuser. So let us create our first user (we are still on the MySQL shell): INSERT INTO `ftpquotalimits`
(`name`, `quota_type`, `per_session`, `limit_type`, `bytes_in_avail`, `bytes_out_avail`,
`bytes_xfer_avail`, `files_in_avail`, `files_out_avail`, `files_xfer_avail`)
VALUES ('exampleuser', 'user', 'true', 'hard', 15728640, 0, 0, 0, 0, 0); (Do not forget to replace the groud- and userid 2001 appropriately in the last INSERT statement if you are using other values than in this tutorial!) Now open your FTP client program on your work station (something like WS_FTP or SmartFTP if you are on a Windows system) and try to connect. As hostname you use server1.example.com (or the IP address of the system), the username is exampleuser, and the password is secret. If you are able to connect - congratulations! If not, something went wrong. Now, if you run ls -l /home you should see that the directory /home/www.example.com (exampleuser's home directory) has been automatically created, and it belongs to ftpuser and ftpgroup (the user/group we created at the end of step two). To leave the MySQL shell, type quit;
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com
Red Hat Virtual Experience - a free virtual event. Dec. 9th





print: 
Recent comments
9 hours 52 min ago
15 hours 40 min ago
17 hours 31 min ago
19 hours 16 min ago
23 hours 6 min ago
1 day 4 hours ago
1 day 5 hours ago
1 day 9 hours ago
1 day 14 hours ago
1 day 20 hours ago