分享
 
 
 

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

王朝mysql·作者佚名  2006-11-23
窄屏简体版  字體: |||超大  

from: http://bbs.bsdbase.com/index.php?s=&act=ST&f=1&t=224&st=0&#entry307

代码:

################## pure-ftpd ###########################

Aborigen Yin

tutu@bsdbase.com

2003.06.07

pure-ftpd + mysql + PureFTP PHP User Management 安装配置实例

freeBSD 4.8 stable

#mysql apache请自行安装。

#文档中的一些路径是我的环境中使用的,请自行修改以符合你的实际情况;

#相关网址:

http://www.pureftpd.org (国内可能无法访问)

http://sourceforge.net

/projects/pureftpd/ (国内现在可以访问了)

8.1.安装

cd /usr/local/src/distfiles

##172.16.100.245是我的文件服务器

wget ftp://172.16.100.245/pub/distfiles/pure-ftpd-1.0.14.tar.gz

tar xfz pure-ftpd-1.0.14.tar.gz -C ..

cd ../pure-ftpd-1.0.14

mkdir -p /usr/local/modules/support/pure-ftpd/etc

mkdir -p /usr/local/modules/support/pure-ftpd/var/run

mkdir -p /usr/local/modules/support/pure-ftpd/var/log

#用puredb;

#使用英文,WITH_LANG=simplified-chinese可以使用简体中文,不过在某些情况下,你可能更希望看到英文;

./configure --prefix=/usr/local/modules/support/pure-ftpd \

--with-everything \

--with-diraliases \

--with-paranoidmsg \

--with-virtualchroot \

--without-shadow \

--with-welcomemsg \

--with-quotas \

--with-sysquotas \

--without-inetd \

--without-banner \

--with-uploadscript \

--with-mysql=/usr/local/modules/support/mysql

#安装程序好象“忘记”这两个文件了

cp configuration-file/pure-ftpd.conf /usr/local/modules/support/pure-ftpd/etc

cp configuration-file/pure-config.pl /usr/local/modules/support/pure-ftpd/sbin

chmod 755 /usr/local/modules/support/pure-ftpd/sbin/pure-config.pl

8.2.配置主配置文件

#程序在/usr/local/modules/support/pure-ftpd/sbin/pure-ftpd,配置文件在/usr/local/modules/support/pure-ftpd/etc/pure-ftpd.conf

#注意一下参数,配置文件中默认的文件位置不对(其实放哪里看自己喜欢罢了);

#vi /usr/local/modules/support/pure-ftpd/etc/pure-ftpd.conf

#begin of pure-ftpd.conf

############################################################

# #

# Configuration file for pure-ftpd wrappers #

# #

############################################################

ChrootEveryone yes

BrokenClientsCompatibility yes

MaxClientsNumber 150

Daemonize yes

MaxClientsPerIP 20

VerboseLog no

DisplayDotFiles no

AnonymousOnly no

NoAnonymous no

SyslogFacility ftp

DontResolve yes

MaxIdleTime 5

MySQLConfigFile /usr/local/modules/support/pure-ftpd/etc/pureftpd-mysql.conf

#PureDB /usr/local/modules/support/pure-ftpd/etc/pureftpd.pdb

LimitRecursion 2000 8

AnonymousCanCreateDirs no

MaxLoad 4

PassivePortRange 40000 50000

#ForcePassiveIP 192.168.0.1

AntiWarez yes

# Bind 127.0.0.1,21

#AnonymousBandwidth 50

# UserBandwidth 8

Umask 133:022

#MinUID 100

MinUID 100

AllowUserFXP yes

AllowAnonymousFXP no

ProhibitDotFilesWrite no

ProhibitDotFilesRead no

AutoRename no

AnonymousCantUpload yes

#NoChmod yes

#Quota 1000:10

PIDFile /usr/local/modules/support/pure-ftpd/var/run/pure-ftpd.pid

AltLog w3c:/usr/local/modules/support/pure-ftpd/var/log/pure-ftpd-w3c.log

MaxDiskUsage 95

CustomerProof yes

#end of pure-ftpd.conf

###日志设置

###没有这一行,ftp日志就会发到/var/log/messages,很讨厌的说。

echo "ftp.* /usr/local/modules/support/pure-ftpd/var/log/pure-ftpd.log" >> /etc/syslog.conf

###

touch /usr/local/modules/support/pure-ftpd/var/log/pure-ftpd-w3c.log

touch /usr/local/modules/support/pure-ftpd/var/log/pure-ftpd.log

#使日志设置生效;

killall -HUP syslogd

#####

#用phpMyAdmin 创建用户配置 ###

user:pureftpd@localhost

passwd:wahaha

database:pureftpd

################为了使用 PureFTPD PHP User Management #####

###mysql 的设置是按照PureFTPD PHP User Management的readme作的。

##

################

http://www.solariz.de

http://www.solariz.de/Ffiledb/filedb.php?action=category&id=1

http://www.solariz.de/Ffiledb/download.php?id=1

#mysql 配置文件。

#vi /usr/local/modules/support/pure-ftpd/etc/pureftpd-mysql.conf

#

# If you want to use the Socket connect methode comment out the

# Lines with MMYSQLServer and MYSQLPort.

# If you want to use the Port methode comment out the MYSQLSocket line

#MYSQLSocket /var/lib/mysql/mysql.sock

MYSQLServer localhost

MYSQLPort 3306

MYSQLUser pureftpd

MYSQLPassword wahaha

MYSQLDatabase pureftpd

MYSQLCrypt cleartext

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")

#end of mysql configure.

#####数据库初始化 ####用phpmyadmin 执行

use pureftpd;

DROP TABLE IF EXISTS ftpd;

CREATE TABLE ftpd (

User varchar(16) NOT NULL default '',

status enum('0','1') NOT NULL default '0',

Password varchar(64) NOT NULL default '',

Uid varchar(11) NOT NULL default '-1',

Gid varchar(11) NOT NULL default '-1',

Dir varchar(128) NOT NULL default '',

ULBandwidth smallint(5) NOT NULL default '0',

DLBandwidth smallint(5) NOT NULL default '0',

comment tinytext NOT NULL,

ipaccess varchar(15) NOT NULL default '*',

QuotaSize smallint(5) NOT NULL default '0',

QuotaFiles int(11) NOT NULL default 0,

PRIMARY KEY (User),

UNIQUE KEY User (User)

) TYPE=MyISAM;

####

####

8.5.虚拟用户管理

#为匿名用户设置帐户,必须有一个系统帐户ftp,匿名ftp才会生效;

#ftp用户的主目录就是匿名ftp的根;

#匿名ftp是为ftp://ftp.anti-spamming.com这个匿名服务器服务的;

userdel ftp

groupdel ftp

groupadd ftp

useradd -g ftp ftp

#虚拟用户统一用这个帐号和组;

pw groupadd virtual

mkdir -p /data/home/virtual

pw useradd virtual -g virtual -d /data/home/virtual -s /sbin/nologin

chown -R virtual:virtual /data/home/virtual

#为了方便管理,clone一个可以登陆的virtual帐号:

#vipw

virtual:x:503:503::/data/home/virtual:/sbin/nologin

vvuser:x:503:503::/data/home/virtual:/bin/sh

#end

#end

修改密码

passwd vvuser

################为了使用 PureFTPD PHP User Management #####

###mysql 的设置是按照PureFTPD PHP User Management的readme作的。

http://www.solariz.de

http://www.solariz.de/Ffiledb/filedb.php?action=category&id=1

http://www.solariz.de/Ffiledb/download.php?id=1

###

cd /usr/local/modules/support/apache/htdocs

fetch ftp://172.16.100.245/pub/distfiles/pureftpd_php_manager.tgz

tar xfz pureftpd_php_manager.tgz

rm -f pureftpd_php_manager.tgz

cd pureftpd_php_manager

#vi pureftp.config.php

<?php

######################

####### SETUP ########

######################

// Your exactly located mysql config file for pureftpd

//$PUREFTP_CONFIG_FILE = '/etc/pureftpd-mysql.conf';

$PUREFTP_CONFIG_FILE = '/usr/local/modules/support/pure-ftpd/etc/pureftpd-mysql.conf';

// The location where all the Forms directed to. (Mayby no change needed)

$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

[1] [2] [3] 下一页

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有