Virtual Hosting With Pure FTPD And MySQL

This project is based on Virtual Hosting With PureFTPd And MySQL (Incl. Quota And Bandwidth Management). You can easily follow the previous tutorial, it works of out the box!.

Database Administration

See the user administration project to set up the database.

Required packages

Install with apt-get install

  • pure-ftpd-mysql

Configuration of pure ftpd server

  • Edit /etc/default/pure-ftpd-common, set:
    STANDALONE_OR_INETD=standalone
  • Main configuration directory is /etc/pure-ftpd
cat /etc/pure-ftpd/conf/AltLog
clf:/var/log/pure-ftpd/transfer.log

cat /etc/pure-ftpd/conf/ChrootEveryone
yes

cat /etc/pure-ftpd/conf/CreateHomeDir
yes

cat /etc/pure-ftpd/conf/MinUID
1000

cat /etc/pure-ftpd/conf/MySQLConfigFile
/etc/pure-ftpd/db/mysql.conf

cat /etc/pure-ftpd/conf/NoAnonymous
yes

cat /etc/pure-ftpd/conf/PAMAuthentication
no

cat /etc/pure-ftpd/conf/PureDB
/etc/pure-ftpd/pureftpd.pdb

cat /etc/pure-ftpd/conf/Quota
10 10

cat /etc/pure-ftpd/conf/UnixAuthentication
no

cat /etc/pure-ftpd/conf/VerboseLog
no
  • Create the site directories, e.g.: /home/ftp/ju.edu.et
  • /etc/pure-ftpd/db/mysql.conf
MYSQLSocket     /var/run/mysqld/mysqld.sock
MYSQLUser       pureftpd
MYSQLPassword   <xxx>
MYSQLDatabase   useradministration
MYSQLCrypt      crypt
MYSQLGetPW      SELECT password FROM view_ftp_accounts WHERE ftp_login="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetUID     SELECT uid FROM view_ftp_accounts WHERE ftp_login="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetGID     SELECT gid FROM view_ftp_accounts WHERE ftp_login="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetDir     SELECT CONCAT('/home/ftp/',home) FROM view_ftp_accounts WHERE ftp_login="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetQTAFS   SELECT quota_files FROM view_ftp_accounts WHERE ftp_login="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetQTASZ   SELECT quota_size FROM view_ftp_accounts WHERE ftp_login="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetBandwidthUL SELECT ul_bandwidth FROM view_ftp_accounts WHERE ftp_login="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetBandwidthDL SELECT dl_bandwidth FROM view_ftp_accounts WHERE ftp_login="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")

Commands

  • See who is logged in: <command>pure-ftpwho</command>
  • /etc/init.d/pure-ftpd restart
vlir/projects/pureftpd.txt · Last modified: 2008/05/19 15:51 by rudy
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki