Results 1 to 6 of 6

Thread: How to Virtual Hosting With PureFTPd And MySQL

  1. #1
    Join Date
    Feb 2010
    Posts
    537

    question How to Virtual Hosting With PureFTPd And MySQL

    Hi all,

    I am using Mandriva 2009.1. I want to know them how to install a PureFTPd server that uses virtual users from a MySQL database instead of real system users. I think it is much more per formant and allows having thousands of ftp users on a single machine. In addition I also want to show the use of quota and upload bandwidth limits with this setup.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to Virtual Hosting With PureFTPd And MySQL

    Mandriva's PureFTPd package supports various backends, such as MySQL, PostgreSQL, LDAP, etc. You need to install it from this command :
    Code:
    urpmi pure-ftpd pure-ftpd-anon-upload pure-ftpd-anonymous
    Then you need to make an ftp group i.e,ftpgroup and user i.e.,ftpuser that all your virtual users will be plan to. Then replace the group and userid 2001 with a number that is liberated on your system:
    Code:
    groupadd -g 2001 ftpgroup
    useradd -u 2001 -s /bin/false -d /bin/null -c "pureftpd user" -g ftpgroup ftpuser
    Check that and reply.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    How to Virtual Hosting With PureFTPd And MySQL

    You need to also make a database called pureftpd and a MySQL user named pureftpd which the PureFTPd daemon will use afterward on to attach to the pureftpd database:
    Code:
    mysql -u root –p
    CREATE DATABASE pureftpd;
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO 'pureftpd'@'localhost' IDENTIFIED BY 'ftpdpass';
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO 'pureftpd'@'localhost.localdomain' IDENTIFIED BY 'ftpdpass';
    FLUSH PRIVILEGES;
    You need to swap the string ftpdpass with whatsoever password you want to use for the MySQL user pureftpd. Best of luck.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: How to Virtual Hosting With PureFTPd And MySQL

    After the Configurition PureFTPd, You can also put the command
    Code:
    Edit /etc/pure-ftpd/pure-ftpd.conf
    and confirm that the ChrootEveryone, MySQLConfigFile, and CreateHomeDir lines are enabled and appear like this:
    Code:
    vi /etc/pure-ftpd/pure-ftpd.conf
    [...]
    ChrootEveryone              yes
    [...]
    MySQLConfigFile               /etc/pure-ftpd/pureftpd-mysql.conf
    [...]
    CreateHomeDir               yes
    [...]
    Basically the ChrootEveryone setting will build PureFTPd chroot each virtual user in his home directory so you will not be talented to browse directories and files outside his home directory. Good luck.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: How to Virtual Hosting With PureFTPd And MySQL

    You also need to Populate The Database And Test the database you can use the MySQL, Use the command:
    Code:
    mysql -u root -p
    USE pureftpd;
    Now you make the user exampleuser with the status , the password secret, the UID and GID 2001 the home directory /home/www.example.com, an upload and download bandwidth of 100 KB/sec and a quota of 50 MB. Check that and reply.

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How to Virtual Hosting With PureFTPd And MySQL

    Whenever you want to create a new user in mysql, you have to create an entry in the table ftpd so you will explain the columns of the table. You should put the ftps table like this – User The name of the virtual PureFTPd user ,Password - The password of the virtual user. check you use MySQL's MD5 function to save the password encrypted as an MD5 string. Best of luck.

Similar Threads

  1. Replies: 4
    Last Post: 13-01-2011, 01:08 AM
  2. Replies: 5
    Last Post: 24-03-2010, 03:15 AM
  3. Replies: 3
    Last Post: 07-11-2009, 09:36 PM
  4. migrate Hyper-V virtual machine to virtual server/virtual PC 2007
    By Larry Scott in forum Windows Server Help
    Replies: 1
    Last Post: 18-03-2008, 03:32 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,065,804.35381 seconds with 16 queries