pure-ftpd + mysql.......Management 安装配置实例( 三 )


$SELF_URL = "index.php";

// The location of your pure-ftpdwho binary (set this to chmod 4711)
//$FTP_WHO = "/usr/local/sbin/pure-ftpwho";
$FTP_WHO = "/usr/local/modules/support/pure-ftpd/sbin";

#######################
# DEFAULT NEW-USER PARAMS #
#######################

$DefaultUser = ""; # Default User Logon
$DefaultPass = ""; # Default User Password
$DefaultUid = "virtual"; # Default User ID ( must be a real user acct )
$DefaultGid = "virtual"; # Default Group ID ( must be a real group acct )
$DefaultDir = "/data/home/virtual"; # Default User Dir ( use /./ at the end to chroot )
$DefaultUL = "0"; # Default Upload Throttle ( 0 disables it )
$DefaultDL = "0"; # Default Download Throttle ( 0 disables it )
$Defaultip = "*"; # Default IP restrictions ( * = any IP )
$DefaultQS = "10240"; # Default Quota Size ( 0 disables it )
$Defaultcmt = "New ftp user"; # Default Comment for user

// UA
$DefaultQF = "10240"; # Default Quota Files ( 0 disables it )
$PWC = "55"; # Vorsatz fuerr Crypt Password
?>
#end


http://172.16.100.249:9180/pureftpd_php_manager

###############
NOTE:
If you want to use VirtualQuaotas your PureFTPD must be
compiled with the "--with-quotas" option.
Else it is better to comment out the line
beginning with MySQLGetQTASZ in the pureftpd-mysql.conf
file or some errors can occure while launching pureftpd.

2nd NOTE:
To set up the PureFTP Who display tool you must set chmod 4711
to yout pure-ftpwho command. Get sure that the Pure-FTPWho command
is executable in this Directory: /usr/local/sbin/
If this isn"t the directory where you"re binary is installed please setup a
symbolic Link. ln -s /usr/local/sbin/pure-ftpwho 【pure-ftpd mysql.......Management 安装配置实例】pure-ftpwho file>


#################
##由于php_manager创建用户时并不创建对应的用户目录 , 使用如下脚本来进行用户创建工作 , php_manager 只用于管理
#vi /usr/local/modules/support/pure-ftpd/bin/vvadduser

#!/bin/sh
#警告:没有任何错误检查
V_BASE="/data/home/virtual"
R_USER="virtual"
R_GROUP="virtual"

#set by user.
V_USERNAME=""
V_PASSWD=""

HTTP_ROOT="public_HTML"
HTTPS_ROOT="https"
HTTP_CGI="cgi-bin"
HTTPS_CGI="cgi-bins"
V_SETTINGS="settings"

MYSQL_HOME=/usr/local/modules/support/mysql
MYSQL_CLIENT=$MYSQL_HOME/bin/mysql

MYSQL_USER=GET_FROM_CFG
MYSQL_PASSWD=GET_FROM_CFG
MYSQL_DB=GET_FROM_CFG
MYSQL_HOST=GET_FROM_CFG
MYSQL_PORT=GET_FROM_CFG

PURE_TABLE=ftpd
PURE_MYSQL_CFG=/usr/local/modules/support/pure-ftpd/etc/pureftpd-mysql.conf
#PURE_PW="/usr/local/modules/support/pure-ftpd/bin/pure-pw"

MYSQL_USER=`grep -v "#" $PURE_MYSQL_CFG | grep "^MYSQLUser" | awk "{ print $2 }" `
if [ -z $MYSQL_USER ]
then
echo "Error:probe mysql user name from $PURE_MYSQL_CFG fail."
exit 1
fi

MYSQL_PASSWD=`grep -v "#" $PURE_MYSQL_CFG | grep "^MYSQLPassword" | awk "{ print $2 }" `
if [ -z $MYSQL_PASSWD ]
then
echo "Error:probe mysql password from $PURE_MYSQL_CFG fail."
exit 1
fi

MYSQL_DB=`grep -v "#" $PURE_MYSQL_CFG | grep "^MYSQLDatabase" | awk "{ print $2 }" `
if [ -z $MYSQL_DB ]
then
echo "Error:probe mysql database $PURE_MYSQL_CFG fail."
exit 1
fi

MYSQL_HOST=`grep -v "#" $PURE_MYSQL_CFG | grep "^MYSQLServer" | awk "{ print $2 }" `
if [ -z $MYSQL_HOST ]
then
echo "Error:probe mysql host from $PURE_MYSQL_CFG fail."
exit 1
fi

MYSQL_PORT=`grep -v "#" $PURE_MYSQL_CFG | grep "^MYSQLPort" | awk "{ print $2 }" `
if [ -z $MYSQL_PORT ]
then
echo "Error:probe mysql port from $PURE_MYSQL_CFG fail."
exit 1
fi

if [ -z $1 ]
then
#$PURE_PW mkdb
echo "Usage: $0 "
exit 1
fi

V_USERNAME=$1
O_TTY=`stty -g`
stty -echo
echo -n "Enter password for Virtual user $V_USERNAME:"

推荐阅读