wiki:Pure-FTPd+MySQL installation
Warning: Can't synchronize with repository "(default)" (/srv/gitolite/repositories/pure-ftpd-webui.git does not appear to be a Git repository.). Look in the Trac log for more information.

Pure-FTPd+MySQL installation

TOC?

Ubuntu.

Pure-ftpd and mysql installation.

Install pure-ftpd and mysql:

root@server:~# apt-get install pure-ftpd pure-ftpd-common pure-ftpd-mysql mysql mysql-common mysql-server php5 php5-mysql apache2

Create group (_ftpgroup_) and user (_ftpuser_) to associate with pure-ftpd users:

root@server:~# groupadd -g 2001 ftpgroup
root@server:~# useradd -u 2001 -s /bin/false -d /bin/null -c "pureftpd user" -g ftpgroup ftpuser

Create pure-ftpd configuration file.

Pure-ftpd configuration file:

root@server:~# echo "
############################################################
#                                                          #
#         Configuration file for pure-ftpd wrappers        #
#                                                          #
############################################################

ChrootEveryone              yes
BrokenClientsCompatibility  no
MaxClientsNumber            50
Daemonize                   yes
MaxClientsPerIP             8
VerboseLog                  yes
DisplayDotFiles             no
AnonymousOnly               no
NoAnonymous                 yes
SyslogFacility              ftp
FortunesFile              /etc/pure-ftpd/cookie
DontResolve                 yes
MaxIdleTime                 15
# LDAPConfigFile                /etc/pureftpd-ldap.conf
MySQLConfigFile               /etc/pure-ftpd/mysql.conf
# PGSQLConfigFile               /etc/pureftpd-pgsql.conf
# PureDB                        /etc/pureftpd.pdb
# ExtAuth                       /var/run/ftpd.sock
# PAMAuthentication             yes
# UnixAuthentication            yes
LimitRecursion              10000 8
AnonymousCanCreateDirs      no
# MaxLoad                     4
# PassivePortRange          30000 50000
# ForcePassiveIP                192.168.0.1
# AnonymousRatio                1 10
# UserRatio                 1 10
AntiWarez                   yes
# Bind                      127.0.0.1,21
# AnonymousBandwidth            8
# UserBandwidth             8
Umask                       133:022
# MinUID                      2001
AllowUserFXP                no
AllowAnonymousFXP           no
ProhibitDotFilesWrite       no
ProhibitDotFilesRead        no
AutoRename                  no
AnonymousCantUpload         no
# TrustedIP                  10.1.1.1
# LogPID                     yes
# AltLog                     clf:/var/log/pureftpd.log
# AltLog                     stats:/var/log/pureftpd.log
# AltLog                     w3c:/var/log/pureftpd.log
NoChmod                     yes
KeepAllFiles                yes
CreateHomeDir               yes
# Quota                       1000:10
PIDFile                     /var/run/pure-ftpd.pid
# CallUploadScript yes
# MaxDiskUsage               99
# NoRename                  yes
CustomerProof              yes
# PerUserLimits            3:20
# NoTruncate               yes
# TLS                      1
IPV4Only                 yes
# IPV6Only                 yes
FileSystemCharset       utf8
ClientCharset           cp1251" > /etc/pure-ftpd/pure-ftpd.conf

Create mysql configuration file for pure-ftpd.

MySQL configuration file for pure-ftpd:

root@server:~# echo "
MYSQLSocket      /var/run/mysqld/mysqld.sock
#MYSQLServer     localhost
#MYSQLPort       3306
MYSQLUser       pureftpd
MYSQLPassword   pureftpdpass
MYSQLDatabase   pureftpd
#MYSQLCrypt md5, cleartext, crypt() or password() - md5 is VERY RECOMMENDABLE uppon cleartext
MYSQLCrypt      md5
MYSQLGetPW      SELECT Password FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetUID     SELECT Uid FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetGID     SELECT Gid FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetDir     SELECT Dir FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetBandwidthUL SELECT ULBandwidth FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetBandwidthDL SELECT DLBandwidth FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetQTASZ   SELECT QuotaSize FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetQTAFS   SELECT QuotaFiles FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")" > /etc/pure-ftpd/mysql.conf

Start apache server:

root@server:~# /etc/init.d/apache2 start

Start mysql server:

root@server:~# /etc/init.d/mysql start

Restart pure-ftpd daemon:

root@server:~# /etc/init.d/pure-ftpd restart

Now you can start Pure-FTPd WebUI installation.

CentOS.

Pure-ftpd and mysql installation.

Install pure-ftpd and mysql:

root@server:~# yum install pure-ftpd mysql mysql-server httpd php php-mysql php-mbstring

Create group (_ftpgroup_) and user (_ftpuser_) to associate with pure-ftpd users:

root@server:~# groupadd -g 2001 ftpgroup
root@server:~# useradd -u 2001 -s /bin/false -d /bin/null -c "pureftpd user" -g ftpgroup ftpuser

Create pure-ftpd configuration file.

Pure-ftpd configuration file:

root@server:~# echo "
############################################################
#                                                          #
#         Configuration file for pure-ftpd wrappers        #
#                                                          #
############################################################

ChrootEveryone              yes
BrokenClientsCompatibility  no
MaxClientsNumber            50
Daemonize                   yes
MaxClientsPerIP             8
VerboseLog                  yes
DisplayDotFiles             no
AnonymousOnly               no
NoAnonymous                 yes
SyslogFacility              ftp
FortunesFile              /etc/pure-ftpd/cookie
DontResolve                 yes
MaxIdleTime                 15
# LDAPConfigFile                /etc/pureftpd-ldap.conf
MySQLConfigFile               /etc/pure-ftpd/mysql.conf
# PGSQLConfigFile               /etc/pureftpd-pgsql.conf
# PureDB                        /etc/pureftpd.pdb
# ExtAuth                       /var/run/ftpd.sock
# PAMAuthentication             yes
# UnixAuthentication            yes
LimitRecursion              10000 8
AnonymousCanCreateDirs      no
# MaxLoad                     4
# PassivePortRange          30000 50000
# ForcePassiveIP                192.168.0.1
# AnonymousRatio                1 10
# UserRatio                 1 10
AntiWarez                   yes
# Bind                      127.0.0.1,21
# AnonymousBandwidth            8
# UserBandwidth             8
Umask                       133:022
# MinUID                      2001
AllowUserFXP                no
AllowAnonymousFXP           no
ProhibitDotFilesWrite       no
ProhibitDotFilesRead        no
AutoRename                  no
AnonymousCantUpload         no
# TrustedIP                  10.1.1.1
# LogPID                     yes
# AltLog                     clf:/var/log/pureftpd.log
# AltLog                     stats:/var/log/pureftpd.log
# AltLog                     w3c:/var/log/pureftpd.log
NoChmod                     yes
KeepAllFiles                yes
CreateHomeDir               yes
# Quota                       1000:10
PIDFile                     /var/run/pure-ftpd.pid
# CallUploadScript yes
# MaxDiskUsage               99
# NoRename                  yes
CustomerProof              yes
# PerUserLimits            3:20
# NoTruncate               yes
# TLS                      1
IPV4Only                 yes
# IPV6Only                 yes
FileSystemCharset       utf8
ClientCharset           cp1251" > /etc/pure-ftpd/pure-ftpd.conf

Create mysql configuration file for pure-ftpd.

MySQL configuration file for pure-ftpd:

root@server:~# echo "
MYSQLSocket      /var/run/mysqld/mysqld.sock
#MYSQLServer     localhost
#MYSQLPort       3306
MYSQLUser       pureftpd
MYSQLPassword   pureftpdpass
MYSQLDatabase   pureftpd
#MYSQLCrypt md5, cleartext, crypt() or password() - md5 is VERY RECOMMENDABLE uppon cleartext
MYSQLCrypt      md5
MYSQLGetPW      SELECT Password FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetUID     SELECT Uid FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetGID     SELECT Gid FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetDir     SELECT Dir FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetBandwidthUL SELECT ULBandwidth FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetBandwidthDL SELECT DLBandwidth FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetQTASZ   SELECT QuotaSize FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetQTAFS   SELECT QuotaFiles FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")" > /etc/pure-ftpd/mysql.conf

Start apache server:

root@server:~# /etc/init.d/httpd start

Start mysql server:

root@server:~# /etc/init.d/mysqld start

Restart pure-ftpd daemon:

root@server:~# /etc/init.d/pure-ftpd restart

Now you can start Pure-FTPd WebUI installation.

Last modified 5 years ago Last modified on Feb 1, 2012, 10:27:53 PM