<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></title> 
<link>http://www.bizeway.net/index.php</link> 
<description><![CDATA[网务通 - 网务公司发展之路]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></copyright>
<item>
<link>http://www.bizeway.net/read.php?</link>
<title><![CDATA[跟着ArthurXF学FreeBSD38——搭建用mysql管理的ftp服务]]></title> 
<author>ArthurXF &lt;arthurxf@gmail.com&gt;</author>
<category><![CDATA[FreeBSD]]></category>
<pubDate>Sat, 05 Jan 2008 03:31:54 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?</guid> 
<description>
<![CDATA[ 
	　　我们用Mysql数据库管理ftp帐号，是多么的方便啊。这里使用Pure-ftpd + Mysql + Pureftpd_php_manager架设FTP，本文由ArthurXF倾情奉献，谢谢支持！<br/>1.用ports安装pure-ftpd<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">cd &nbsp;/usr/ports/ftp/pure-ftpd<br/>make config<br/> &nbsp; [X] LDAP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Support for users in LDAP directories &nbsp;支持LDAP路径<br/> &nbsp;[X] MYSQL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Support for users in MySQL database 支持MYSQL数据库管理<br/> &nbsp;[X] PAM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Support for PAM authentication &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 支持PAM验证<br/> &nbsp;[ ] PGSQL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Support for users in PostgreSQL database &nbsp;支持PostgreSQL数据库管理<br/> &nbsp;[X] PRIVSEP &nbsp; &nbsp; &nbsp; &nbsp;Enable privilege separation &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;支持特权分离<br/> &nbsp;[X] PERUSERLIMITS &nbsp;Per-user concurrency limits &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;同时ftp用户限制<br/> &nbsp;[X] THROTTLING &nbsp; &nbsp; Bandwidth throttling &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 带宽限制<br/> &nbsp;[X] BANNER &nbsp; &nbsp; &nbsp; &nbsp; Show pure-ftpd welcome upon session start 登录ftp服务器显示欢迎广告<br/> &nbsp;[X] UPLOADSCRIPT &nbsp; Support uploadscript daemon &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;支持上传后台程序<br/> &nbsp;[X] UTF8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Support for charset conversion (expreimental) 支持字符转换<br/> &nbsp;[X] SENDFILE &nbsp; &nbsp; &nbsp; Support for the sendfile syscall 支持sendfile系统调用<br/>将上面的选择，具体的作用，请参看解释，可根据需要选择。<br/>make install clean</div></div><br/><br/>2添加ftp用户和组<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">pw groupadd ftpusers -g 2001<br/>pw useradd ftp -u 2001 -g ftpusers -s /sbin/nologin<br/>mkdir -p /home/ftp<br/>chown ftp /home/ftp</div></div><br/><br/>3.建立mysql数据库<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><div class="code">CREATE DATABASE pureftpd;<br/>GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO &#039;pureftpd&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;arthurxf&#039;;<br/>GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO &#039;pureftpd&#039;@&#039;localhost.localdomain&#039; IDENTIFIED BY &#039;arthurxf&#039;;<br/>FLUSH PRIVILEGES;<br/>USE pureftpd;<br/>DROP TABLE IF EXISTS ftpd;<br/>CREATE TABLE ftpd (<br/>User varchar(16) NOT NULL default &#039;&#039;,<br/>status enum(&#039;0&#039;,&#039;1&#039;) NOT NULL default &#039;0&#039;,<br/>Password varchar(64) NOT NULL default &#039;&#039;,<br/>Uid varchar(11) NOT NULL default &#039;-1&#039;,<br/>Gid varchar(11) NOT NULL default &#039;-1&#039;,<br/>Dir varchar(128) NOT NULL default &#039;&#039;,<br/>ULBandwidth smallint(5) NOT NULL default &#039;0&#039;,<br/>DLBandwidth smallint(5) NOT NULL default &#039;0&#039;,<br/>comment tinytext NOT NULL,<br/>ipaccess varchar(15) NOT NULL default &#039;*&#039;,<br/>QuotaSize smallint(5) NOT NULL default &#039;0&#039;,<br/>QuotaFiles int(11) NOT NULL default 0,<br/>PRIMARY KEY (User),<br/>UNIQUE KEY User (User)<br/>) TYPE=MyISAM;</div><br/>注意：arthurxf是密码，如果有需要请修改。<br/>将上面的内容，保存成为pureftpd.sql后，执行下面的命令<br/><div class="code">/usr/local/bin/mysql &lt; ./pureftpd.sql</div></div></div><br/><br/><br/>4.安装pureftpd_php_manager<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">下载我配置好的pureftpd_php_manager包<br/>cd /usr/local/www/<br/>wget http://www.bizeway.net/attachment/pureftpd_php_manager.tar<br/>tar xzvf pureftpd_php_manager.tar</div></div><br/><br/><br/>5.配置pureftpd-mysql.conf<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">cd /usr/local/etc<br/>vi pureftpd-mysql.conf<br/>将下面的内容复制到pureftpd-mysql.conf，保存退出<br/>MYSQLSocket &nbsp; &nbsp; /tmp/mysql.sock<br/>MYSQLServer &nbsp; &nbsp; localhost<br/>MYSQLPort &nbsp; &nbsp; &nbsp; 3306<br/>MYSQLUser &nbsp; &nbsp; &nbsp; pureftpd<br/>MYSQLPassword &nbsp; arthurxf<br/>MYSQLDatabase &nbsp; pureftpd<br/>MYSQLCrypt &nbsp; &nbsp; &nbsp;cleartext<br/>MYSQLGetPW &nbsp; &nbsp; &nbsp;SELECT Password FROM ftpd WHERE User="&#92;L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "&#92;R")<br/>MYSQLGetUID &nbsp; &nbsp; SELECT Uid FROM ftpd WHERE User="&#92;L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "&#92;R")<br/>MYSQLGetGID &nbsp; &nbsp; SELECT Gid FROM ftpd WHERE User="&#92;L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "&#92;R")<br/>MYSQLGetDir &nbsp; &nbsp; SELECT Dir FROM ftpd WHERE User="&#92;L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "&#92;R")<br/>MySQLGetBandwidthUL SELECT ULBandwidth FROM ftpd WHERE User="&#92;L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "&#92;R")<br/>MySQLGetBandwidthDL SELECT DLBandwidth FROM ftpd WHERE User="&#92;L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "&#92;R")<br/>MySQLGetQTASZ &nbsp; SELECT QuotaSize FROM ftpd WHERE User="&#92;L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "&#92;R")<br/>MySQLGetQTAFS &nbsp; SELECT QuotaFiles FROM ftpd WHERE User="&#92;L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "&#92;R")<br/>如果你没改动第3步中的的'arthurxf'密码，那你就什么都不需要修改，可以直接使用了。如果你修改过了，就要将MYSQLPassword &nbsp; arthurxf 中的arthurxf修改成你自己设置的密码。</div></div><br/><br/>6.配置Pureftpd<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">cd /usr/local/etc<br/>cp pure-ftpd.conf.sample pure-ftpd.conf<br/><br/><div class="code">下面是完整pure-ftpd的中文配置文件，共大家学习之用<br/>############################################################ <br/># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# <br/># &nbsp; &nbsp; &nbsp; &nbsp; Configuration file for pure-ftpd wrappers &nbsp; &nbsp; &nbsp; &nbsp;# <br/># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# <br/>############################################################ <br/><br/># 如果你想要使用配置文件代替命令行选项来运行 Pure-FTPd ，请运行下面的命令： <br/># <br/># /usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf <br/># <br/># RPM 缺省使用另外一个配置文件： <br/># /etc/sysconfig/pure-ftpd <br/># <br/># 请不要忘了浏览一下 http://www.pureftpd.org/documentation.html 的 <br/># 文档，查看全部的选项列表。 <br/><br/># 限制所有用户在其主目录中 <br/><br/> ChrootEveryone &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;yes <br/><br/><br/># 如果前一个指令被设置为了 &quot;no&quot;，下面组的成员(GID)就不受主目录的限制了。而其他的用户还是 <br/># 会被限制在自己的主目录里。如果你不想把任何用户限制在自己的主目录里，只要注释掉 ChrootEveryone <br/># 和 TrustedGID 就可以了。 <br/><br/># TrustedGID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100 <br/><br/># 兼容ie等比较非正规化的ftp客户端 <br/><br/> BrokenClientsCompatibility &nbsp;no <br/><br/># 服务器总共允许同时连接的最大用户数 <br/><br/> MaxClientsNumber &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;50 <br/><br/># 做为守护(doemon)进程运行(Fork in background) <br/><br/> Daemonize &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yes <br/><br/># 同一IP允许同时连接的用户数（Maximum number of sim clients with the same IP address） <br/><br/> MaxClientsPerIP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 8 <br/><br/># 如果你要记录所有的客户命令，设置这个指令为 &quot;yes&quot;。 <br/># This directive can be duplicated to also log server responses. <br/><br/> VerboseLog &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;no <br/><br/># 即使客户端没有发送 &#039;-a&#039; 选项也列出隐藏文件( dot-files )。 <br/><br/> DisplayDotFiles &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yes <br/><br/># 不允许认证用户 - 仅作为一个公共的匿名FTP。 <br/><br/> AnonymousOnly &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; no <br/><br/># 不允许匿名连接，仅允许认证用户使用。 <br/><br/> NoAnonymous &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; no <br/><br/># Syslog facility (auth, authpriv, daemon, ftp, security, user, local*) <br/># 缺省的功能( facility )是 &quot;ftp&quot;。 &quot;none&quot; 将禁止日志。 <br/><br/> SyslogFacility &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ftp <br/><br/># 定制用户登陆后的显示信息（Display fortune cookies） <br/><br/># FortunesFile &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/usr/share/fortune/zippy <br/><br/># 在日志文件中不解析主机名。日志没那么详细的话，就使用更少的带宽。在一个访问量很大 &nbsp;<br/># 的站点中，设置这个指令为 &quot;yes&quot; ，如果你没有一个能工作的DNS的话。 <br/><br/> DontResolve &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yes <br/><br/># 客户端允许的最大的空闲时间（分钟，缺省15分钟） <br/><br/> MaxIdleTime &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 15 <br/><br/># LDAP 配置文件 (参考 README.LDAP) <br/><br/># LDAPConfigFile &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/etc/pureftpd-ldap.conf <br/><br/># MySQL 配置文件 (参考 README.MySQL) <br/><br/># MySQLConfigFile &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /etc/pureftpd-mysql.conf <br/><br/># Postgres 配置文件 (参考 README.PGSQL) <br/><br/># PGSQLConfigFile &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /etc/pureftpd-pgsql.conf <br/><br/># PureDB 用户数据库 (参考 README.Virtual-Users) <br/><br/># PureDB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/etc/pureftpd.pdb <br/><br/># pure-authd 的socket 路径(参考 README.Authentication-Modules) <br/><br/># ExtAuth &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /var/run/ftpd.sock <br/><br/># 如果你要启用 PAM 认证方式, 去掉下面行的注释。 <br/><br/># PAMAuthentication &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yes <br/><br/># 如果你要启用 简单的 Unix系统 认证方式(/etc/passwd), 去掉下面行的注释。 <br/><br/># UnixAuthentication &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;yes <br/><br/># 请注意，LDAPConfigFile, MySQLConfigFile, PAMAuthentication 和 <br/># UnixAuthentication 这些指令只能被使用一次，不过，他们能被混合在一起用。例如：如果你使用了 <br/># MySQLConfigFile 和 UnixAuthentication，那么 SQL 服务器将被访问。如果因为用户名未找 <br/># 到而使 SQL 认证失败的话，就会在/etc/passwd 和 /etc/shadow 中尝试另外一种认证，如果因 <br/># 为密码错误而使 SQL 认证失败的话，认证就会在此结束了。认证方式由它们被给出来的顺序而被链 <br/># 接了起来。 <br/><br/># &#039;ls&#039; 命令的递归限制。第一个参数给出文件显示的最大数目。第二个参数给出最大的子目录深度。 <br/><br/> LimitRecursion &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2000 8 <br/><br/># 允许匿名用户创建新目录？ <br/><br/> AnonymousCanCreateDirs &nbsp; &nbsp; &nbsp;no <br/><br/># 如果系统被 loaded 超过下面的值，匿名用户会被禁止下载。 <br/><br/> MaxLoad &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4 <br/><br/># 被动连接响应的端口范围。- for firewalling. <br/><br/># PassivePortRange &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;30000 50000 <br/><br/># 强制一个IP地址使用被动响应（ PASV/EPSV/SPSV replies）。 - for NAT. <br/># Symbolic host names are also accepted for gateways with dynamic IP <br/># addresses. <br/><br/># ForcePassiveIP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;192.168.0.1 <br/><br/># 匿名用户的上传/下载的比率。 <br/><br/># AnonymousRatio &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 10 <br/><br/># 所有用户的上传/下载的比率。 <br/># This directive superscedes the previous one. <br/><br/># UserRatio &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 10 <br/><br/># 不接受所有者为 &quot;ftp&quot; 的文件的下载。例如：那些匿名用户上传后未被本地管理员验证的文件。 <br/><br/> AntiWarez &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yes <br/><br/># 服务监听的IP 地址和端口。(缺省是所有IP地址和21端口) <br/><br/># Bind &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;127.0.0.1,21 <br/><br/># 匿名用户的最大带宽（KB/s）。 <br/><br/># AnonymousBandwidth &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8 <br/><br/># 所有用户的最大带宽（KB/s），包括匿名用户。 <br/># Use AnonymousBandwidth *or* UserBandwidth, both makes no sense. <br/><br/># UserBandwidth &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 8 <br/><br/># 新建目录及文件的属性掩码值。&lt;文件掩码&gt;;:&lt;目录掩码&gt;; . <br/># 177:077 if you feel paranoid. <br/><br/> Umask &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 133:022 <br/><br/># 认证用户允许登陆的最小组ID（UID） 。 <br/><br/> MinUID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100 <br/><br/># 仅允许认证用户进行 FXP 传输。 <br/><br/> AllowUserFXP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;yes <br/><br/># 对匿名用户和非匿名用户允许进行匿名 FXP 传输。 <br/><br/> AllowAnonymousFXP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; no <br/><br/># 用户不能删除和写点文件（文件名以 &#039;.&#039; 开头的文件），即使用户是文件的所有者也不行。 <br/># 如果 TrustedGID 指令是 enabled ，文件所属组用户能够访问点文件(dot-files)。 <br/><br/> ProhibitDotFilesWrite &nbsp; &nbsp; &nbsp; no <br/><br/># 禁止读点文件（文件名以 &#039;.&#039; 开头的文件） (.history, .ssh...) <br/><br/> ProhibitDotFilesRead &nbsp; &nbsp; &nbsp; &nbsp;no <br/><br/># 永不覆盖文件。当上传的文件，其文件名已经存在时，自动重命名，如： file.1, file.2, file.3, ... <br/><br/> AutoRename &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;no <br/><br/># 不接受匿名用户上传新文件( no = 允许上传) <br/><br/> AnonymousCantUpload &nbsp; &nbsp; &nbsp; &nbsp; no <br/><br/># 仅允许来自以下IP地址的非匿名用户连接。你可以使用这个指令来打开几个公网IP来提供匿名FTP， <br/># 而保留一个私有的防火墙保护的IP来进行远程管理。你还可以只允许一内网地址进行认证，而在另外 <br/># 一个IP上提供纯匿名的FTP服务。 <br/><br/>#TrustedIP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;10.1.1.1 <br/><br/><br/># 如果你要为日志每一行添加 PID &nbsp;去掉下面行的注释。 <br/><br/># LogPID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yes <br/><br/># 使用类似于Apache的格式创建一个额外的日志文件，如： <br/># fw.c9x.org - jedi &#91;13/Dec/1975&#93; &quot;GET /ftp/linux.tar.bz2&quot; 200 21809338 <br/># 这个日志文件能被 www 流量分析器处理。 <br/><br/># AltLog &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clf:/var/log/pureftpd.log <br/><br/><br/># 使用优化过的格式为统计报告创建一个额外的日志文件。 <br/><br/># AltLog &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stats:/var/log/pureftpd.log <br/><br/><br/># 使用标准的W3C格式创建一个额外的日志文件。（与大部分的商业日志分析器兼容） <br/><br/># AltLog &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; w3c:/var/log/pureftpd.log <br/><br/># 不接受 CHMOD 命令。用户不能更改他们文件的属性。 <br/><br/># NoChmod &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yes <br/><br/><br/># 允许用户恢复和上传文件，却不允许删除他们。 <br/><br/># KeepAllFiles &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;yes <br/><br/><br/># 用户主目录不存在的话，自动创建。 <br/><br/># CreateHomeDir &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yes <br/><br/># 启用虚拟的磁盘限额。第一个数字是最大的文件数。 <br/># 第二个数字是最大的总的文件大小(单位：Mb)。 <br/># 所以，1000:10 就限制每一个用户只能使用 1000 个文件，共10Mb。 <br/><br/># Quota &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1000:10 <br/><br/># 如果你的 pure-ftpd 编译时加入了独立服务器( standalone )支持，你能够改变 pid 文件 <br/># 的位置。缺省位置是 /var/run/pure-ftpd.pid 。 <br/><br/># PIDFile &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /var/run/pure-ftpd.pid <br/><br/># 如果你的 pure-ftpd 编译时加入了 pure-uploadscript 支持，这个指令将会使 pure-ftpd <br/># 发送关于新上传的情况信息到 /var/run/pure-ftpd.upload.pipe，这样 pure-uploadscript <br/># 就能读然后调用一个脚本去处理新的上传。 <br/><br/># CallUploadScript yes <br/><br/># 这个选项对允许匿名上传的服务器是有用的。当 /var/ftp 在 /var 里时，需要保留一定磁盘空间 <br/># 来保护日志文件。当所在磁盘分区使用超过百分之 X 时，将不在接受新的上传。 <br/><br/> MaxDiskUsage &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 99 <br/><br/># 如果你不想要你的用户重命名文件的话，就设置为 &#039;yes&#039; 。 <br/><br/># NoRename yes <br/><br/># 是 &#039;customer proof&#039; : 工作区(workaround)反对普通的客户错误，类似于：&#039;chmod 0 public_html&#039; 的错误。 <br/># 那是一个有效的命令，不过，将导致无知的客户所定他们自己的文件，将使你的技术支持忙于愚蠢的的问题中。 <br/># 如果你确信你所有的用户都有基本的Unix知识的话，这个特性将没什么用了。不过，如果你是一个主机提供商 <br/># 的话，启用它。 <br/><br/>CustomerProof yes <br/><br/># 每一个用户的并发限制。只有在添加了 --with-peruserlimits 编译选项进行编译后，这个指令才起 <br/># 作用。(大部分的二进制的发布版本就是例子) <br/># 格式是 : &lt;每一个用户最大允许的进程&gt;;:&lt;最大的匿名用户进程&gt;; <br/># 例如： 3:20 意思是同一个认证用户最大可以有3个同时活动的进程。而且同时最多只能有20个匿名用户进程。 <br/><br/># PerUserLimits 3:20</div><br/><br/>我们只需要修改下面几个参数即可<br/>vi pure-ftpd.conf<br/># Cage in every user in his home directory<br/># 限制每个用户到自己的根目录<br/>ChrootEveryone &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;yes<br/># Disallow anonymous connections. Only allow authenticated users.<br/># 取消anonymous用户<br/>NoAnonymous &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yes<br/># MySQL configuration file (see README.MySQL)<br/># pureftpd-mysql.conf文件的位置<br/>MySQLConfigFile &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /usr/local/etc/pureftpd-mysql.conf<br/># 服务监听的IP 地址和端口。(缺省是所有IP地址和21端口) ,不修改<br/># Bind &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;127.0.0.1,21<br/>#只写一个数字为端口号<br/>Bind &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2221 <br/></div></div><br/><br/>7.随系统启动<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">vi /etc/rc.conf<br/>加入下面的内容<br/>pureftpd_enable="YES"<br/>然后重起即可。<br/>或者使用命令启动<br/>/usr/local/sbin/pure-config.pl /usr/local/etc/pure-ftpd.conf<br/></div></div><br/><br/>8.加密pureftpd_php_manager目录<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">为了避免外人非法进入管理我们的ftp。我们必须对ftp的管理目录做验证处理。<br/>修改apache的httpd.conf，加入下面的语句<br/><div class="code">Alias /ftpamdin &quot;/usr/local/www/pureftpd_php_manager/&quot;<br/>&lt;Directory &quot;/usr/local/www/pureftpd_php_manager/&quot;&gt;<br/> &nbsp; &nbsp;deny from all<br/> &nbsp; &nbsp;Options None<br/> &nbsp; &nbsp;AllowOverride AuthConfig<br/> &nbsp; &nbsp;Order deny,allow<br/>&lt;/Directory&gt;</div><br/><br/>本来还需要进入/usr/local/www/pureftpd_php_manager/配置.passwd文件，我那个包里面已经配置了，所以这里就不再重复了。<br/><br/>接下来操作<br/>cd /usr/local/etc<br/>htpasswd -bc pureftpd.passwd arthur 123456<br/>然后重起apache，访问http://你的ip/ftpamdin，需要用户名和密码就说明配置成功了。</div></div><br/><br/>　　此文章由ArthurXF倾情奉献，谢谢支持！<br/><br/>现在ArthurXF本人正在搞PHP等技术培训，如果想学习的人可以跟我联系。另外培训的招生简章在这个网址，想了解的可以去看看。加我QQ：29011218交流也可。<br/><a href="http://www.bizeway.net/read.php/285.htm" target="_blank">PHP培训招生简章</a><br/>Tags - <a href="tag.php?tag=pure-ftpd" rel="tag">pure-ftpd</a> , <a href="tag.php?tag=pureftpd_php_manager" rel="tag">pureftpd php manager</a>
]]>
</description>
</item><item>
<link>http://www.bizeway.net/read.php?&amp;guid=0#topreply</link>
<title><![CDATA[[评论] 跟着ArthurXF学FreeBSD38——搭建用mysql管理的ftp服务]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?&amp;guid=0#topreply</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>