PureFTPD+MySQL安装

10月 10th, 2007

PureFTPD+MySQL安装
=============================================
echo “/usr/local/mysql/lib/mysql/” >> /etc/ld.so.conf
ldconfig

./configure –prefix=/usr/local/pureftpd \
–with-boring \
–with-paranoidmsg \
–with-sysquotas \
–with-altlog \
–with-puredb \
–with-extauth \
–with-pam \
–with-cookie \
–with-throttling \
–with-ratios \
–with-quotas \
–with-ftpwho \
–with-largefile \
–with-welcomemsg \
–with-uploadscript \
–with-virtualhosts \
–with-virtualchroot \
–with-diraliases \
–with-peruserlimits \
–with-language=simplified-chinese \
–with-ldap \
–with-mysql \
–with-privsep \
–with-tls \
–with-shadow \

make
make check
make install
chmod 755 configuration-file/pure-config.pl
cp configuration-file/pure-config.pl /usr/local/pureftpd/sbin/
cp configuration-file/pure-ftpd.conf /usr/local/etc/
cp contrib/redhat.init /etc/init.d/pureftpd
chmod 755 /etc/init.d/pureftpd
chown root:root /etc/init.d/pureftpd
chkconfig –add pureftpd
chkconfig pureftpd on

vi /etc/init.d/pureftpd
Path to the pure-ftp binaries.
prog=pure-config.pl
fullpath=/usr/local/pureftpd/sbin/$prog
pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho

=============================================
# MYSQLServer     127.0.0.1
# MYSQLPort       3306

MYSQLSocket             /tmp/mysql.sock
MYSQLUser               pureftpd
MYSQLPassword           b1ea2e6a18
MYSQLDatabase           srv_pureftpd
MYSQLCrypt              cleartext
MYSQLGetPW              SELECT Password FROM users WHERE User=”\L”
MYSQLGetUID             SELECT Uid FROM users WHERE User=”\L”
MYSQLGetGID             SELECT Gid FROM users WHERE User=”\L”
MYSQLGetDir             SELECT Dir FROM users WHERE User=”\L”

MySQLGetQTASZ           SELECT QuotaSize FROM users WHERE User=”\L”
MySQLGetQTAFS           SELECT QuotaFiles FROM users WHERE User=”\L”
MySQLGetRatioUL         SELECT ULRatio FROM users WHERE User=”\L”
MySQLGetRatioDL         SELECT DLRatio FROM users WHERE User=”\L”
MySQLGetBandwidthUL     SELECT ULBandwidth FROM users WHERE User=”\L”
MySQLGetBandwidthDL     SELECT DLBandwidth FROM users WHERE User=”\L”
=============================================

grant select,insert,update,delete on srv_pureftpd.* to pureftpd@localhost identified by “pureftpd”

CREATE DATABASE srv_pureftpd;

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(32) unsigned NOT NULL auto_increment,
  `User` varchar(16) NOT NULL default ”,
  `Password` varchar(64) NOT NULL default ”,
  `Uid` varchar(11) NOT NULL default ‘3000′,
  `Gid` varchar(11) NOT NULL default ‘3000′,
  `Dir` varchar(128) NOT NULL default ‘/usr/local/httpd/www/’,
  `QuotaSize` smallint(5) NOT NULL,
  `QuotaFiles` int(11) NOT NULL default ‘0′,
  `ULBandwidth` smallint(5) NOT NULL default ‘0′,
  `DLBandwidth` smallint(5) NOT NULL default ‘0′,
  `ULRatio` smallint(6) NOT NULL default ‘0′,
  `DLRatio` smallint(6) NOT NULL default ‘0′,
  `ipaccess` varchar(15) NOT NULL default ‘*’,
  `status` enum(’0′,’1′) NOT NULL default ‘0′,
  `create_date` datetime NOT NULL default ‘0000-00-00 00:00:00′,
  `modify_date` datetime NOT NULL default ‘0000-00-00 00:00:00′,
  `comment` tinytext NOT NULL,
  PRIMARY KEY  (`id`,`User`),
  UNIQUE KEY `User` (`User`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;



发表回复