分享
 
 
 

pure-ftpd的安装和使用

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

一,系统支持

系统中需要安装有 Mysql+Apache+Dns(可选).

二,准备软件

Ftpd Server :

pure-ftpd-1.0.20.tar.gz

pureftpd_php_manager:

pureftpd_php_manager.tar.gz

三,定制安装

1:解压缩

到下载的两个文件所在目录.

#cd download

#tar zxvf pure-ftpd-1.0.20.tar.gz

#tar zxvf pureftpd_php_manager.tar.gz

2:编译

#cd pure-ftpd-1.0.20

#./configure --prefix=/usr/local/pureftpd --with-mysql=/usr/local/mysql --with-puredb \ ---------->>这个可别忘记了,我就是因为忘记了这个,结果浪费了很多时间

--with-paranoidmsg --with-shadow --with-welcomemsg --with-uploadscript --with-quotas --with-cookie --with-pam --with-virtualhosts --with-virtualroot --with-diraliases --with-sysquotas --with-ratios --with-ftpwho --with-throttling

--with-language=simplified-chinese --------------->>Socket 会话显示出来的信息的语言.缺省为英语,simplified-chinese 简体中文,traditional-chinese BIG5繁体中文

--with-mysql=/usr/local/mysql \ 此处的 /usr/local/mysql 请改为你的mysql实际安装路径.如果出现类似configure: error: Your MySQL client libraries aren't properly installed 的错误,请将mysql目录下的 include/mysql下的mysql.h文件以及lib/mysql下的全部文件,连接(直接复制过去或许也可)到 /usr/lib 目录下

3:安装

#make

#make check

#make install

#cd configuration-file

#chmod u+x pure-config.pl

#cp pure-config.pl /usr/local/sbin/

#cp pure-ftpd.conf /usr/local/etc/

将pureftpd_php_manager目录拷贝到网站目录下

cp -R pureftpd_php_manager /opt/www/pureftpd_php_manager

四,配置服务

1:编辑/usr/local/etc/pure-ftpd.conf文件

找到

#CreateHomeDir yes

改为

CreateHomeDir yes

作用是,用户登录,如果主目录不存在,便自动建立.

找到

Umask 133:022

改为

Umask 755:755

设定新文件的默认属性.

找到

# MySQLConfigFile /etc/pureftpd-mysql.conf

改为

MySQLConfigFile /usr/local/etc/pureftpd-mysql.conf

设定ftpd服务的参数取得为pureftpd-mysql.conf

文件设置

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

存盘退出.

2:编辑/usr/local/etc/pureftpd-mysql.conf文件

它的大概样子是这样的

源码:##############################################

# #

# Sample Pure-FTPd Mysql configuration file. #

# See README.MySQL for explanations. #

# #

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

# Optional : MySQL server name or IP. Don't define this for unix sockets.

MYSQLServer localhost

#服务器地址

# 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 /opt/mysql/var/mysql.sock

#这里换成你的真实地址

# Mandatory : user to bind the server as.

MYSQLUser root

#登录服务器用户名

# Mandatory : user password. You must have a password.

MYSQLPassword 123456

#登录服务器密码

# Mandatory : database to open.

MYSQLDatabase ftpd

#配置文件所在的数据库

# Mandatory : how passwords are stored

# Valid values are : "cleartext", "crypt", "md5" and "password"

# ("password" = MySQL password() function)

# You can also use "any" to try "crypt", "md5" *and* "password"

MYSQLCrypt cleartext

#验证方式

# In the following directives, parts of the strings are 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 the user connected to.

# \P is replaced by the port number the user connected to.

# \R is replaced by the IP address 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 in order to fetch the password

MYSQLGetPW SELECT Password FROM users WHERE User="\L" AND status="1"

#登录服务器的用户密码验证字段,status="1"为此用户必需为激活模式.

# Query to execute in order to fetch the system user name or uid

MYSQLGetUID SELECT Uid FROM users WHERE User="\L"

#用户的UID

# Optional : default UID - if set this overrides MYSQLGetUID

#MYSQLDefaultUID 1000

# Query to execute in order to fetch the system user group or gid

MYSQLGetGID SELECT Gid FROM users WHERE User="\L"

#用户的Gid

# Optional : default GID - if set this overrides MYSQLGetGID

#MYSQLDefaultGID 1000

# Query to execute in order to fetch the home directory

MYSQLGetDir SELECT Dir FROM users WHERE User="\L"

#用户的主目录

# Optional : query to get the maximal number of files

# Pure-FTPd must have been compiled with virtual quotas support.

MySQLGetQTAFS SELECT QuotaFiles FROM users WHERE User="\L"

#用户的最大文件数量

# Optional : query to get the maximal disk usage (virtual quotas)

# The number should be in Megabytes.

# Pure-FTPd must have been compiled with virtual quotas support.

MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User="\L"

#用户的最大磁盘空间

# Optional : ratios. The server has to be compiled with ratio support.

MySQLGetRatioUL SELECT ULBandwidth FROM users WHERE User="\L"

MySQLGetRatioDL SELECT DLBandwidth FROM users WHERE User="\L"

#上边两项为,用户上传与下载的速度,单位 Kb/s

# Optional : bandwidth throttling.

# The server has to be compiled with throttling support.

# Values are in KB/s .

# MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User="\L"

# MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User="\L"

# Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :

# 1) You know what you are doing.

# 2) Real and virtual users match.

# MySQLForceTildeExpansion 1

# If you upgraded your tables to transactionnal tables (Gemini,

# BerkeleyDB, Innobase...), you 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

保存退出

请按您的实际情况修改.或者直接找错后复制过去.

3:修改:/opt/www/pureftpd_php_manager/pureftp.config.php文件

源码:######################

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

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

// 设置pureftpd-mysql.conf的位置,这个要注意,不要写错哦

$PUREFTP_CONFIG_FILE = '/usr/local/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";

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

# DEFAULT NEW-USER PARAMS #

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

$DB_TABLE='users'; #新增加变量,定义数据表名

$DefaultUser = "ftpuser"; # 默认用户

$DefaultPass = "passwd"; # 默认初始用户密码

$DefaultUid = "48"; # 默认的uid(设置为apache的uid,你的或许不是48,为PHP建立的目录能够正常使用而设置)

$DefaultGid = "48"; # 默认的gid(设置为apache的gid,你的或许不是48,为PHP建立的目录能够正常使用而设置)

$DefaultDir = "/var/ftproot/ftpusershome"; # 默认的用户主目录

$DefaultUL = "0"; # 默认用户上传速率限制(KB/S)

$DefaultDL = "0"; # 默认用户下载速率限制(KB/S)

$Defaultip = "*"; # 设置用户可以从哪些IP登陆

$DefaultQS = "50"; # 用户默认的quota

$Defaultcmt = ""; # 默认备注信息

$DefaultQF = "0"; # 默认文件数目quota

$PWC = "55"; # Vorsatz fuerr Crypt Password

保存退出

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
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- 王朝網路 版權所有