Pureftp+mysql Verification
FTP the principle
+ ports are open for connection. port for data transfer!
Anonymous user
Anonymous
Active mode and Passive mode
Active mode is the client active, for example with 1030 Port Connection + , and then open 1031 and the - port to transmit data, but if there is a firewall that cannot be actively transferred, the server will open larger than 1024x768 port and connect through the client
TAR-XJVF pure-ftpd-1.0.22.tar.bz2
./configure–prefix=/usr/local/pureftpd–with-mysql=/usr/local/mysql–with-paranoidmsg–with-shadow– with-welcomemsg–with-uploadscript–with-quotas–with-cookie–with-virtualhosts–with-virtualroot–with-diraliases– With-sysquotas–with-ratios–with-ftpwho–with-throttling–with-language=simplified-chinese
–with-mysql=/usr/local/mysql \/usr/local/mysql Here please change your MySQL actual installation path. If a similar configure:error:Your MySQL client appears libraries aren ' t properly installed error, please connect the Include/mysql file under Mysql.h in the MySQL directory and all files under Lib/mysql (direct copy may also be possible) to/usr/ Lib Directory (reference)
cp/usr/local/mysql/lib/libmysqlclent*/usr/lib ( Real Solution )
# #运行 Ldconfig, load all shared link libraries
Cp-a ftp/var/www/html/pureftp
Make && make install
CP configuration-file/pure-config.pl/usr/local/pureftpd/sbin/
chmod +x/usr/local/pureftpd/sbin/pure-config.pl
CP Configuration-file/pure-ftpd.conf/etc
Make/ftproot
Build pure-ftp Service Management Scripts
Edit Contrib sub-directory inside Redhat.int file
fullpath=/usr/local/sbin/$prog
Switch
fullpath=/usr/local/pureftpd/sbin/$prog
Pureftpwho=/usr/local/sbin/pure-ftpwho
Switch
Pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho
CP CONTRIB/REDHAT.INIT/ETC/INIT.D/PURE-FTPD
chmod +x/etc/init.d/pure-ftpd
Chkconfig–add pure-ftpd
installation user Mamager for pure-ftpd make Web Management pure-ftp
TAR-XZVF ftp_v2.1.tar.gz
Cp-a ftp/var/www/html/pureftp
in the browser input. ip/pureftp/install.php
Step-by-step creation!!
Touch/etc/pureftp-mysql.conf
Copy the following to the file.
############################################################################
# #
# pureftpd MySQL configuration file. #
# Generated by the Installation wizard for the ' User Manager for PUREFTPD ' #
# See http://machiel.generaal.net for more info #
# or read the README. MySQL for explanations of the syntax. #
# #
############################################################################
# Optional:mysql server name or IP. Don ' t define this for UNIX sockets.
MySQLServer 127.0.0.1
# Optional:mysql Port. Don ' t define this if a local UNIX socket is used.
# Mysqlport 3306
# Optional:define The location of Mysql.sock if the server runs on this host.
Mysqlsocket /tmp/mysql.sock
# Mandatory:user to bind the server as.
Mysqluser FTP
# mandatory:user password. You must has a password.
Mysqlpassword tmppasswd
# Mandatory:database to open.
Mysqldatabase Ftpusers
# mandatory:how passwords is stored
# Valid values are: "Cleartext", "Crypt", "MD5" and "password"
# ("Password" = MySQL password () function)
# can also use ' any ' to try "crypt", "MD5" *and* "password"
Mysqlcrypt MD5
# in the following directives, parts of the strings is replaced at
# Run-time before performing queries:
#
# \l is replaced by the login of the user trying to authenticate.
# \i is replaced by the IP address of the user connected to.
# \p is replaced by the port number the user connected to.
# \ R is replaced by the IP address of the user connected from.
# \d is replaced by the remote IP address, as a long decimal number.
#
# Very complex queries can be performed using these substitution strings,
# especially for virtual hosting.
# Query to execute on order to fetch the password
MYSQLGETPW Select Password from the users WHERE user= "\l" and status= "1" and (Ipaddress = "*" OR Ipaddress like "\ r")
# Query to execute on order to fetch the system user name or UID
Mysqlgetuid Select Uid from the users WHERE user= "\l" and status= "1" and (Ipaddress = "*" OR Ipaddress like "\ r")
# Optional:default Uid-if Set this overrides Mysqlgetuid
#MYSQLDefaultUID 1000
# Query to execute on order to fetch the system user group or GID
Mysqlgetgid Select Gid from the users WHERE user= "\l" and status= "1" and (Ipaddress = "*" OR Ipaddress like "\ r")
# Optional:default Gid-if Set this overrides Mysqlgetgid
#MYSQLDefaultGID 1000
# Query to execute on order to fetch the home directory
Mysqlgetdir Select Dir from the users WHERE user= "\l" and status= "1" and (Ipaddress = "*" OR Ipaddress like "\ r")
# Optional:query to get the maximal number of files
# PURE-FTPD must has been compiled with virtual quotas support.
Mysqlgetqtafs Select Quotafiles from the users WHERE user= "\l" and status= "1" and (Ipaddress = "*" OR Ipaddress like "\ r")
# Optional:query to get the maximal disk usage (virtual quotas)
# The number should is in megabytes.
# PURE-FTPD must has been compiled with virtual quotas support.
Mysqlgetqtasz Select Quotasize from the users WHERE user= "\l" and status= "1" and (Ipaddress = "*" OR Ipaddress like "\ r")
# Optional:ratios. The server has been compiled with ratio support.
Mysqlgetratioul Select Ulratio from the users WHERE user= "\l" and status= "1" and (Ipaddress = "*" OR Ipaddress like "\ r")
Mysqlgetratiodl Select Dlratio from the users WHERE user= "\l" and status= "1" and (Ipaddress = "*" OR Ipaddress like "\ r")
# Optional:bandwidth Throttling.
# The server has been compiled with throttling support.
# Values is in kb/s.
Mysqlgetbandwidthul Select Ulbandwidth from the users WHERE user= "\l" and status= "1" and (Ipaddress = "*" OR Ipaddress like "\ R ")
MYSQLGETBANDWIDTHDL Select Dlbandwidth from the users WHERE user= "\l" and status= "1" and (Ipaddress = "*" OR Ipaddress like "\ R ")
# Enable ~ expansion. Never ENABLE this blindly unless:
# 1) You know is doing.
# 2) Real and virtual users match.
# mysqlforcetildeexpansion 1
# If you upgraded your tables to transactionnal tables (Gemini,
# BerkeleyDB, Innobase ...), can enable SQL transactions to
# Avoid races. Leave this commented if you are using the
# traditionnal MyIsam databases or old (< 3.23.x) MySQL versions.
# mysqltransactions on
in the /etc/pure-ftp.conf
Add a sentence
Mysqlconfigfile/etc/pureftpd-mysql.conf
Service pure-ftpd Start
PUREFTP installation Configuration