免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: b.s.d
打印 上一主题 下一主题

[FreeBSD] [发表]FreeBSD全能服务器安装手册v0.0.7 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2006-06-20 11:27 |只看该作者
FreeBSD全能服务器安装手册之内核编译篇

################################编译系统内核###################################
进入内核编辑区域
cd /usr/src

多线程支持加快编译速度(注意:cpu的占用率会升高)
make -j4 buildworld

备份原有内核
cd /usr/src/sys/i386/conf
cp GENERIC  /root/GENERIC.OLD

编辑内核
ee NS1

建立内核
cd /usr/src
make buildkernel

安装内核
make installkernel

重新启动计算机
shutdown -r now

mergemaster -p
更新系统配置文件。这个命令后会跟随多个提示问题建议仔细阅读后做出选择,如果是安装系统后第一次同步代码,并是在没有安装任何软件的情况下,可以考虑执行mergemaster –ai
“跳过询问信息选择全部更新”
提示如下:
www# mergemaster -p

*** Creating the temporary root environment in /var/tmp/temproot
*** /var/tmp/temproot ready for use
*** Creating and populating directory structure in /var/tmp/temproot



*** Beginning comparison

*** Temp ./etc/master.passwd and installed have the same CVS Id, deleting
*** Temp ./etc/group and installed have the same CVS Id, deleting

*** Comparison complete

Do you wish to delete what is left of /var/tmp/temproot? [no] yes
//我选择了yes删除/var/tmp/temproot
//将会有以下显示结果
*** /var/tmp/temproot has been deleted

grep: /etc/make.conf: No such file or directory

*** Comparing make variables

*** From /etc/make.conf
*** From /usr/src/share/examples/etc/make.conf





更新系统配置文件
cd /usr/src
make installworld

mergemaster
shutdown -r now



删除/usr/obj(以防影响下一次编译内核)
cd /usr/obj
chflags -R noschg *
rm -rf *

论坛徽章:
0
12 [报告]
发表于 2006-06-20 11:28 |只看该作者
FreeBSD全能服务器安装手册之底层软件安装篇

##############################安装perl5.8.X#####################################
Perl介绍
Perl(Practical Extraction and Report Language)是一种脚本语言。 最初的设计者为拉里•沃尔(Larry Wall),它于1987年12月18日发表。Perl借取了C、sed、awk、shell scripting以及很多其他程序语言的特性。
Perl原名pearl。在这个语言官方发表前,拉里•沃尔发现已经有个程序语言“pearl”,便改变将这个程序语言的名字改成Perl。Perl这个名字,出现了一些backronym的建议,包括充满幽默感的“Pathologically Eclectic Rubbish Lister”。今日,“Practical Extraction and Report Language”出现了在很多有关Perl的资料里,包括官方的man pages。它的名字第一个字母大写(Perl)时就指这个程序语言,无大写字母(perl)时就指它的直译器。将Perl写成“PERL”是不适当的,所为它并非一个缩写字。
Perl具有动态语言的强大灵活的特性,并起提供了许多冗余语法,也因此获得了write-only的“美誉”,因为许多Perl程序的代码令人难以阅读。但Perl同样可以将代码书写得像Python等语言一样优雅。
Perl主要应用在Unix平台和网页中(PHP,CGI)。Perl拥有海量的模块支持,在解决问题时非常方便。CPAN是Perl模块的集中营。和C一样,在Perl界,难以读懂的程序码大赛是个有名的活动。近似难以读懂的程序码,但方向不同,Perl Poetry是可以被perl编译的诗。新的诗经通常会在Perl Monks (http://www.perlmonks.org/index.pl?node=Perl%20Poetry)网站发表。另一个Perl hackers的有趣活动是写JAPHs。
##############################################################################################################################################################

cd /usr/ports/lang/perl5.8

make WITH_DEBUGGING=yes \
WITH_GDBM=yes \
WITHOUT_PERL_MALLOC=yes \
WITHOUT_PERL_64BITINT=yes \
WITH_THREADS=yes \
ENABLE_SUIDPERL=yes
(注意:以上命令及参数是按行输入)
make test
make install
make clean
make rmconfig
rehash
perl -v
ps auwx|grep perl
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_perl5.8.txt




###############更改ports软件包的默认下载路径(因为只有安装了perl后才会有/etc/make.conf)#######
ee /etc/make.conf

添加
MASTER_SITE_OVERRIDE= \
ftp://ftp.tw.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
ftp://ftp4.tw.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
ftp://ftp10.tw.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
ftp://ftp13.tw.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
ftp://ftp3.jp.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
ftp://ftp5.jp.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
ftp://ftp.jaist.ac.jp/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}

(更改ports默认的下载路径,可以根据自己的实际情况进行设置)
rehash


################################安装openssl####################################
OpenSSL简介
OpenSSL项目是共同努力开发出来的一个健全的、商业级的、全开放的和开放源代码的工具包,实现安全套接层协议(SSL v2/v3)和传输层安全协议(TLS v1)以及形成一个功效完整的通用目的的加密技术库。该项目是由全世界范围内团体的志愿者管理着,他们使用因特网进行交流、策划和开发这个OpenSSL工具和相关的文档。
OpenSSL基于Eric A. Young 和 Tim J. Hudson开发的优秀的SSLeay库(http://www.columbia.edu/~ariel/ssleay/)。OpenSSL工具包使用许可类似Apache,这意味着任何人在服从一些简单的许可协议下,可以免费的获取并且应用于商业、非商业目的。
##############################################################################################################################################################cd /usr/ports/security/openssl
make
make install
make clean
make rmconfig
rehash
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_openssl.txt



#################################安装web管理系统##############################
WEBMIN介绍
“Webmin 是一个基于 Web 的 Unix 系统管理界面。借助任何支持表格和表单的浏览器(和 File Manager 模块所需要的 Java),您就可以设置用户帐号、Apache、DNS、文件共享,等等。Webmin 包括一个简单的 Web 服务器和许多 CGI 程序,这些程序可以直接修改系统文件,比如 /etc/inetd.conf 和 /etc/passwd。Web 服务器和所有的 CGI 程序都是用 Perl 5 编写的,没有使用任何非标准 Perl 模块。”
Webmin 事实上可以运行于所有的类 Unix 平台,包括 Linux、AIX、HPUX、Solaris、OS X,等等。它具有一个 Web 前端,可以完成 Linux 中的诸多管理任务。它可以以本地方式或者远程方式运行于任意图形化浏览器中。Webmin 使用 SSL 来保证安全,防止侦听。当您学习 Linux 管理时,Webmin 将为您节省很多时间。Webmin 还可以帮您完成那些还不能自动执行的繁琐的任务。Webmin 是可扩展的。作者提供了一个开发向导,而且已经出现了一些第三方的模块。您也可以设计您自己的模块,以使 Webmin 永远可以按您的需要进行调整。
##############################################################################################################################################################

cd /usr/ports/sysutils/webmin
make
make install
make clean
make rmconfig

配置webmin(用户名、密码、端口等)
/usr/local/lib/webmin/setup.sh

启动webmin
/usr/local/etc/webmin/start

测试webmin
https://计算机名:端口号

https://192.168.0.118:10000/
使webmin同系统一起启动
ee /etc/rc.conf
添加
webmin_enable="YES"

pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_webmin.txt
###############################安装expat2#####################################
cd /usr/ports/textproc/expat2
make
make install
make clean
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_expat2.txt

论坛徽章:
0
13 [报告]
发表于 2006-06-20 11:28 |只看该作者
FreeBSD全能服务器安装手册之数据库安装篇


#################################安装数据库mysql4.0############################
MySQL介绍
MySQL是一个开放源码的小型关系型数据库管理系统,开发者为MySQL AB公司。目前MySQL被广泛地应用在Internet上的中小型网站中。由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,许多中小型网站为了降低网站总体拥有成本而选择了MySQL作为网站数据库。
MySQL的特性
使用C和C++编写,并使用了多种编译器进行测试,保证源代码的可移植性
支持AIX、FreeBSD、HP-UX、Linux、Mac OS、Novell Netware、OpenBSD、OS/2 Wrap、Solaris、Windows等多种操作系统
为多种编程语言提供了API。这些编程语言包括C、C++、Eiffel、Java、Perl、PHP、Python、Ruby和Tcl等。
支持多线程,充分利用CPU资源
优化的SQL查询算法,有效地提高查询速度
既能够作为一个单独的应用程序应用在客户端服务器网络环境中,也能够作为一个库而嵌入到其他的软件中
提供多语言支持,常见的编码如中文的GB2312、GB18030、BIG5,日文的SJIS等都可以用作数据表名和数据列名
提供TCP/IP、ODBC和JDBC等多种数据库连接途径
提供用于管理、检查、优化数据库操作的管理工具
可以处理拥有上千万条记录的大型数据库

MySQL的应用
与其他的大型数据库例如Oracle、DB2、SQL Server等相比,MySQL自有它的不足之处,如规模小、功能有限(MySQL不支持视图(已经被列入5.1版的开发计划)、存储过程、事件等)等,但是这丝毫也没有减少它受欢迎的程度。对于一般的个人使用者和中小型企业来说,MySQL提供的功能已经绰绰有余,而且由于MySQL是开放源码软件,因此可以大大降低总体拥有成本。

目前Internet上流行的网站构架方式是LAMP(Linux+Apache+MySQL+PHP),即使用Linux作为操作系统,Apache作为Web服务器,MySQL作为数据库,PHP作为服务器端脚本解释器。由于这四个软件都是遵循GPL的开放源码软件,因此使用这种方式不用花一分钱就可以建立起一个稳定、免费的网站系统。

MySql管理
可以使用命令行工具管理MySQL 数据库(命令mysql 和 mysqladmin),你也可以从MySQL 的网站下载图形管理工具MySQL Administrator (http://www.mysql.com/products/administrator) 和 MySQL Query Browser (http://www.mysql.com/products/query-browser).

phpMyAdmin是由php写成的,很流行的开源web程序。

hpMyBackupPro, 也是由PHP写成的,可以创建和管理数据库。它可以创建伪cronjobs,可以用来自动在某个时间或周期备份MySQL 数据库
##############################################################################################################################################################

cd /usr/ports/databases/mysql40-server
make WITH_CHARSET=gbk \
WITH_XCHARSET=all \
SKIP_DNS_CHECK=yes \
BUILD_OPTIMIZED=yes \
BUILD_STATIC=yes
make install
make clean
make rmconfig

pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_mysql40-server.txt



%%%%%%%%%%%%安装mysql40组件%%%%%%%%%%%%%%
cd /usr/ports/databases/p5-DBD-mysql40
make
make install
make clean
make rmconfig

%%%%%%%%%%%使mysql40和系统一起启动%%%%%%%%%%%
ee /etc/rc.conf
mysql_enable="YES"

%%%%%%%%%%启动mysql40%%%%%%%%%%%%%%%%%%%
/usr/local/etc/rc.d/mysql-server.sh start

%%%%%%%%%%%设置mysql40的密码%%%%%%%%%%%%%%
/usr/local/bin/mysqladmin -u root password 'password'

%%%%%%%%%%%测试数据库登陆%%%%%%%%%%%%%%%%
mysql -u root -ppassword

pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_mysql40.txt

论坛徽章:
0
14 [报告]
发表于 2006-06-20 11:29 |只看该作者
FreeBSD全能服务器安装手册之底层服务器篇


###############################安装web服务器apache1.33######################
APACHE介绍
Apache是一个历史悠久并且功能十分强大的WEB服务器,但其丰富的功能对于一个新手来说往往不知道从何下手。我个人感觉Apache的设计充分体现了模块化设计的优势,通过在动态模块加载(DSO)模式下的安装,任何子应用模块都可以通过配置文件的简单修改进行积木式的灵活配置。安装的过程可以从简单的静态html服务开始,一个模块一个模块的学习使用。从单纯的HTML静态服务(core),到复杂的动态页面服务(core + php, core + resin, core + php + mod_gzip, core + resin + mod_expire)。
##############################################################################################################################################################


cd /usr/ports/www/apache13
make
make install
make clean

%%%%%%%%%%%使apache和系统一起启动%%%%%%%%%%%
ee /etc/rc.conf
添加
apache_enable="YES"

%%%%%%%%%%%%更改apache的相应设置%%%%%%%%%%%
ee /usr/local/etc/apache/httpd.conf
change 330  
ServerAdmin you@your.address ==>ServerAdmin b.s.d@163.com  
change 348  
#ServerName www.example.com==>ServerName www.tjhaina.net  
添加              794   
AddLanguage zh-cn .zh-cn
添加              822   
AddCharset GB2312 .gb2312
添加                   976
NameVirtualHost 192.168.0.205 (your hosts ip)

%%%%%%%%%%%%启动apache%%%%%%%%%%%%%%%%%
/usr/local/sbin/apachectl start
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_apache.txt


####################################安装php###################################
PHP介绍

PHP 的全名就蛮有趣的,它是一个递归的缩写名称,"PHP: Hypertext Preprocessor",打开缩写还是缩写。PHP 是一种 HTML 内嵌式的语言 (类似 IIS 上的 ASP)。而 PHP 独特的语法混合了 C、Java、Perl 以及 PHP 式的新语法。它可以比 CGI 或者 Perl 更快速的执行动态网页。
PHP 最初是在公元 1994 年 Rasmus Lerdorf 开始计划发展。在 1995 年以 Personal Home Page Tools (PHP Tools) 开始对外发表第一个版本。在这早期的版本中,提供了访客留言本、访客计数器等简单的功能。随后在新的成员加入开发行列之后,在 1995 年中,第二版的 PHP 问市。第二版定名为 PHP/FI(Form Interpreter)。PHP/FI 并加入了 mSQL 的支持,自此奠定了 PHP 在动态网页开发上的影响力。在 1996 年底,有一万五千个 Web 网站使用 PHP/FI;在 1997 年中,使用 PHP/FI 的 Web 网站成长到超过五万个。而在 1997 年中,开始了第三版的开发计划,开发小组加入了 Zeev Suraski 及 Andi Gutmans,而第三版就定名为 PHP3。

PHP3 跟 Apache 服务器紧密结合的特性;加上它不断的更新及加入新的功能;并且它几乎支持所有主流与非主流数据库;再以它能高速的执行效率,使得 PHP 在 1999 年中的使用网站超过了十五万!!它的源代码完全公开,在 Open Source 意识抬头的今天,它更是这方面的中流砥柱。不断地有新的函数库加入,以及不停地更新的活力,使得 PHP 无论在 UNIX 或是 Win32 的平台上都可以有更多新的功能。它提供丰富的函数,使得在程序设计方面有着更好的支持。

PHP 的第四代 Zend 核心引擎已经进入测试阶段。整个脚本程序的核心大幅改动,让程序的执行速度,满足更快的要求。在最佳化之后的效率,已较传统 CGI 或者 ASP 等程序有更好的表现。而且还有更强的新功能、更丰富的函数库。无论您接不接受,PHP 都将在 Web CGI 的领域上,掀起巅覆性的革命。对于一位专职 Web Master 而言,它将也是必修课程之一。
##############################################################################################################################################################
cd /usr/ports/lang/php4
make
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                     Options for php4 4.4.2_1                       x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x         [X] DEBUG      Enable debug                            x x
x x         [X] MULTIBYTE  Enable zend multibyte support           x x
x x         [X] IPV6       Enable ipv6 support                     x x
x x         [X] OPENSSL    Build static OpenSSL extension          x x
x x                                                                x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
x                       [  OK  ]       Cancel                        x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
make install
make clean
make rmconfig
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_php4.txt



###################################安装php扩展################################
cd /usr/ports/lang/php4-extensions
make (+  bz2)
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                 Options for php4-extensions 1.0                    x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x  [ ] BCMATH       bc style precision math functions            x x
x x  [ ] BZ2          bzip2 library support                        x x
x x  [ ] CALENDAR     calendar conversion support                  x x
x x  [ ] CRACK        crack support                                x x
x x  [X] CTYPE        ctype functions                              x x
x x  [ ] CURL         CURL support                                 x x
x x  [ ] DBA          dba support                                  x x
x x  [ ] DBASE        dBase library support                        x x
x x  [ ] DBX          dbx support                                  x x
x x  [ ] DIO          Direct I/O support                           x x
x x  [ ] DOMXML       DOM support                                  x x
x x  [ ] EXIF         EXIF support                                 x x
x x  [ ] FILEINFO     fileinfo support                             x x
x x  [ ] FILEPRO      filePro support                              x x
x x  [ ] FRIBIDI      FriBidi support                              x x
x x  [ ] FTP          FTP support                                  x x
x x  [ ] GD           GD library support                           x x
x x  [ ] GETTEXT      gettext library support                      x x
x x  [ ] GMP          GNU MP support                               x x
x x  [ ] ICONV        iconv support                                x x
x x  [ ] IMAGICK      ImageMagick support                          x x
x x  [ ] IMAP         IMAP support                                 x x
x x  [ ] INTERBASE    Interbase 6 database support (Firebird)      x x
x x  [ ] LDAP         OpenLDAP support                             x x
x x  [ ] MBSTRING     multibyte string support                     x x
x x  [ ] MCAL         Modular Calendar Access Library support      x x
x x  [ ] MCRYPT       Encryption support                           x x
x x  [ ] MCVE         MCVE support                                 x x
x x  [ ] MHASH        Crypto-hashing support                       x x
x x  [ ] MING         ming shockwave flash support                 x x
x x  [ ] MNOGOSEARCH  mnoGoSearch support                          x x
x x  [ ] MSSQL        MS-SQL database support                      x x
x x  [X] MYSQL        MySQL database support                       x x
x x  [ ] NCURSES      ncurses support (CLI only)                   x x
x x  [ ] ODBC         unixODBC support                             x x
x x  [ ] OPENSSL      OpenSSL support                              x x
x x  [ ] ORACLE       Oracle support                               x x
x x  [X] OVERLOAD     user-space object overloading support        x x
x x  [ ] PANDA        panda support                                x x
x x  [ ] PCNTL        pcntl support (CLI only)                     x x
x x  [X] PCRE         Perl Compatible Regular Expression support   x x
x x  [ ] PDF          PDFlib support (implies GD)                  x x
x x  [ ] PFPRO        PayFlow Pro support                          x x
x x  [ ] PGSQL        PostgreSQL database support                  x x
x x  [X] POSIX        POSIX-like functions                         x x
x x  [ ] PSPELL       pspell support                               x x
x x  [ ] READLINE     readline support (CLI only)                  x x
x x  [ ] RECODE       recode support                               x x
x x  [X] SESSION      session support                              x x
x x  [ ] SHMOP        shmop support                                x x
x x  [ ] SNMP         SNMP support                                 x x
x x  [ ] SOCKETS      sockets support                              x x
x x  [ ] SYBASE_CT    Sybase database support                      x x
x x  [ ] SYSVMSG      System V message support                     x x
x x  [ ] SYSVSEM      System V semaphore support                   x x
x x  [ ] SYSVSHM      System V shared memory support               x x
x x  [X] TOKENIZER    tokenizer support                            x x
x x  [ ] WDDX         WDDX support (implies XML)                   x x
x x  [X] XML          XML support                                  x x
x x  [ ] XMLRPC       XMLRPC-EPI support                           x x
x x  [ ] XSLT         XSLT Sablotron support                       x x
x x  [ ] YAZ          YAZ support (ANSI/NISO Z39.50)               x x
x x  [ ] YP           YP/NIS support                               x x
x x  [ ] ZIP          ZIP support                                  x x
x x  [X] ZLIB         ZLIB support                                 x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
x                       [  OK  ]       Cancel                        x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

make install
make clean
make rmconfig
cd /usr/local/etc
cp php.ini-dist php.ini
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_php4-extensions.txt

论坛徽章:
0
15 [报告]
发表于 2006-06-20 11:31 |只看该作者
FreeBSD全能服务器安装手册之文件服务器篇
--安装配置篇

cd /usr/ports/ftp/pure-ftpd
make WITH_WELCOMESG=yes WITH_UPLOADSCRIPT=yes WITH_COOKIE=yes \
WITH_VIRTUALHOSTS=yes WITH_VIRTUALROOT=yes WITH_DIRALIASES=yes \
WITH_QUOTAS=yes WITH_SYSQUOTAS=yes WITH_RATIOS=yes \
WITH_RATIOS=yes WITH_THROTTLING=yes \
WITH_MYSQL=1 WITH_LANG=simplified-chinese \
WITH_EVERYHING=yes WITH_PARANOIDMSG=yes \
WITH_VIRTUALCHROOT=yes WITH_TLS=yes \
WITH_LARGEFILE=yes


lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                   Options for pure-ftpd 1.0.21                     x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x[ ] LDAP           Support for users in LDAP directories        x x
x x[X] MYSQL          Support for users in MySQL database          x x
x x[X] PAM            Support for PAM authentication               x x
x x[ ] PGSQL          Support for users in PostgreSQL database     x x
x x[ ] PRIVSEP        Enable privilege separation                  x x
x x[ ] PERUSERLIMITS  Per-user concurrency limits                  x x
x x[X] THROTTLING     Bandwidth throttling                         x x
x x[X] BANNER         Show pure-ftpd welcome upon session start    x x
x x[X] UPLOADSCRIPT   Support uploadscript daemon                  x x
x x[ ] UTF8           Support for charset conversion (expreimental)x x
x x                                                                x x
x x                                                                x x
x x                                                                x x
x x                                                                x x
x x                                                                x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
x                       [  OK  ]       Cancel                        x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

make install
make clean
make rmconfig
cd /usr/local/etc
cp pureftpd-mysql.conf.sample pureftpd-mysql.conf
cp pure-ftpd.conf.sample pure-ftpd.conf



####################################建立ftp用户组##############################

pw groupadd ftpusers -g 2000
pw useradd ftp -u 2000 -g ftpusers -s /sbin/nologin
###############################################################################
#################将以下代码保存成文本文件并命名成script.mysql####################
INSERT INTO mysql.user (Host, User, Password, Select_priv, Insert_priv,
Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv,
Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv,
Index_priv, Alter_priv) VALUES
('localhost','ftp',PASSWORD('passwd'),'Y','Y','Y','Y','N','N','N','N',
'N','N','N','N','N','N');

FLUSH PRIVILEGES;

CREATE DATABASE ftpusers;

USE ftpusers;

CREATE TABLE admin (
Username varchar(35) NOT NULL default '',
Password char(32) binary NOT NULL default '',
PRIMARY KEY (Username)
) TYPE=MyISAM;

INSERT INTO admin VALUES ('Administrator',MD5('passwd'));

CREATE TABLE users (
User char(16) NOT NULL default '',
Password char(32) binary NOT NULL default '',
Uid int(11) NOT NULL default '2000',
Gid int(11) NOT NULL default '2000',
Dir char(128) NOT NULL default '',
QuotaFiles int(10) NOT NULL default '500',
QuotaSize int(10) NOT NULL default '30',
ULBandwidth int(10) NOT NULL default '80',
DLBandwidth int(10) NOT NULL default '80',
status enum('0','1') NOT NULL default '1',
ipaccess varchar(15) NOT NULL default '*',
comment tinytext NOT NULL,
PRIMARY KEY (User),
UNIQUE KEY User (User)
) TYPE=MyISAM;

INSERT INTO `users` VALUES ('test1',MD5('123456'),2001,2000,'/home/test1',500,30,80,5,1,'*','*');
##############################################################################################################################################################


#################################添加ftp用户数据库#############################
mysql -u root -ppassword < script.mysql

###############################################################################
################################设置pureftpd-mysql.conf##########################
ee /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.
#选择:MySQL服务器的名字或IP地址。没有对unix 套接字作出详细定义
# MYSQLServer     127.0.0.1
#MYSQL服务器的                                                        IP

# Optional : MySQL port. Don't define this if a local unix socket is used.
#选择:MySQL服务器对外服务的端口。如果本地UNIX端口已经被使用,则这个连接不能#被使用
# MYSQLPort       3306
#MYSQL           端口号

# Optional : define the location of mysql.sock if the server runs on this host.

MYSQLSocket     /tmp/mysql.sock
#使用UNIX.sock本地连接

# Mandatory : user to bind the server as.

MYSQLUser       root
#MYSQL中存放FTP用户的数据库的用户名

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

MYSQLPassword   rootpw
#MYSQL中存放FTP用户的数据库的密码

# Mandatory : database to open.

MYSQLDatabase   pureftpd
#MYSQL中存放FTP用户的数据库的名字

# 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
#密码加密方式"cleartext", "crypt", "md5" and "password"
# cleartext 明文,crypt,md5,password是Backend password(‘your-passwd’)函数(MYSQL
#数据库所使用的password()函数)
# 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"
# 密码字段,我使用users表中的Password做为密码字段

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

MYSQLGetUID     SELECT Uid FROM users WHERE User="\L"
#UID用户ID字段

# Optional : default UID - if set this overrides MYSQLGetUID

#MYSQLDefaultUID 1000
#默认的UID (注:如何开启该选项,MYSQLGetUID将失去作用)

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

MYSQLGetGID     SELECT Gid FROM users WHERE User="\L"
#GID组ID字段

# Optional : default GID - if set this overrides MYSQLGetGID

#MYSQLDefaultGID 1000
#默认的GID (注:如何开启该选项,MYSQLGetGID将失去作用)

# Query to execute in order to fetch the home directory

MYSQLGetDir     SELECT Dir FROM users WHERE User="\L"
#从数据库中获取FTP用户目录如/home/web/www-9812-net

# 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"
#磁盘限额,文件数限制。如1000,允许用户上传1千个文件

# 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"
#磁盘限额,FTP用户空间限制(单位为M),如:100M

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

# MySQLGetRatioUL SELECT ULRatio FROM users WHERE User="\L"
# MySQLGetRatioDL SELECT DLRatio FROM users WHERE User="\L"
#上传/下载比率。MySQLGetRatioUL为上传比,MySQLGetRatioDL下载比。如:1:5

# 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"
#下传/下载带宽(单位KB/s)。MySQLGetBandwidthUL上传带宽,MySQLGetBandwidthDL3

论坛徽章:
0
16 [报告]
发表于 2006-06-20 11:39 |只看该作者
#下载带宽。如上传500KB/s,下载50KB/s

# Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
# 1) You know what you are doing.
# 1)你知道你正在做什么?
# 2) Real and virtual users match.
# 2)真实的和虚拟的用户相匹配
# 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
# 此文的配置文件可以根据个人的实际需要来配置完成
#############################################################################################################################################################################################################################################


###############################################################################
#################################设置pure-ftpd.conf##############################
ee /usr/local/etc/pure-ftpd.conf

############################################################
#                                                          #
#         Configuration file for pure-ftpd wrappers        #
#                                                          #
############################################################

# If you want to run Pure-FTPd with this configuration   
# instead of command-line options, please run the
# following command :
#
# /usr/local/sbin/pure-config.pl /usr/local/etc/pure-ftpd.conf
#
# Please don't forget to have a look at documentation at
# http://www.pureftpd.org/documentation.shtml for a complete list of
# options.

# Cage in every user in his home directory

ChrootEveryone              yes
# chroot每一个用户,等同于Proftpd 中的DefaultRoot~ , 可以限制用户在某个地方活动,增
# 强服务器的安全性。使用户不能通过cd命令进入上一级目录。


# If the previous option is set to "no", members of the following group
# won't be caged. Others will be. If you don't want chroot()ing anyone,
# just comment out ChrootEveryone and TrustedGID.

# TrustedGID                    100
#以上两者要一起用


# Turn on compatibility hacks for broken clients

BrokenClientsCompatibility  no



# Maximum number of simultaneous users

MaxClientsNumber            50
#最大链接数


# Fork in background

Daemonize                   yes
#Fork in background 以守护进程方式在后台运行


# Maximum number of sim clients with the same IP address

MaxClientsPerIP             8
#每个ip最多链接数,最好设小点。


# If you want to log all client commands, set this to "yes".
# This directive can be duplicated to also log server responses.

VerboseLog                  no
#是否要把所有client端的指令都log下来


# List dot-files even when the client doesn't send "-a".

DisplayDotFiles             yes
#显示开头的文件


# Don't allow authenticated users - have a public anonymous FTP only.

AnonymousOnly               no
#是否只让匿名登录


# Disallow anonymous connections. Only allow authenticated users.

NoAnonymous                 no
#不开放匿名登入


# Syslog facility (auth, authpriv, daemon, ftp, security, user, local*)
# The default facility is "ftp". "none" disables logging.

SyslogFacility              ftp
# 应该是对日志做一下过滤 (auth, authpriv, daemon, ftp, security, user, local*)可以让日志只
# 记录想要的信息


# Display fortune cookies

# FortunesFile              /usr/share/fortune/zippy



# Don't resolve host names in log files. Logs are less verbose, but
# it uses less bandwidth. Set this to "yes" on very busy servers or
# if you don't have a working DNS.

DontResolve                 yes
#不反向解释客户端的ip


# Maximum idle time in minutes (default = 15 minutes)

MaxIdleTime                 15
#最大闲置时间(分钟)


# LDAP configuration file (see README.LDAP)

# LDAPConfigFile                /etc/pureftpd-ldap.conf
#使用LDAP认证


# MySQL configuration file (see README.MySQL)

# MySQLConfigFile               /etc/pureftpd-mysql.conf
#使用MySQL认证  注意:配置文件的正确路径

# Postgres configuration file (see README.PGSQL)

# PGSQLConfigFile               /etc/pureftpd-pgsql.conf
#使用PGSQL认证

# PureDB user database (see README.Virtual-Users)

# PureDB                        /etc/pureftpd.pdb
#使用者资料的DB存放地点 [由于我是用PureFTPD的內建DB.固有此选项

# Path to pure-authd socket (see README.Authentication-Modules)


# ExtAuth                       /var/run/ftpd.sock
#pure-authd socket 路径 (详细请看 README.Authentication-Modules)


# If you want to enable PAM authentication, uncomment the following line

# PAMAuthentication             yes
#开启PAM认证


# If you want simple Unix (/etc/passwd) authentication, uncomment this

# UnixAuthentication            yes
#如果你想要有简单的Unix(/etc/passwd)的认证


# Please note that LDAPConfigFile, MySQLConfigFile, PAMAuthentication and
# UnixAuthentication can be used only once, but they can be combined
# together. For instance, if you use MySQLConfigFile, then UnixAuthentication,

[ 本帖最后由 b.s.d 于 2006-6-20 11:45 编辑 ]

论坛徽章:
0
17 [报告]
发表于 2006-06-20 11:44 |只看该作者
#下载带宽。如上传500KB/s,下载50KB/s

# Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
# 1) You know what you are doing.
# 1)你知道你正在做什么?
# 2) Real and virtual users match.
# 2)真实的和虚拟的用户相匹配
# 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
# 此文的配置文件可以根据个人的实际需要来配置完成
#############################################################################################################################################################################################################################################


###############################################################################
#################################设置pure-ftpd.conf##############################
ee /usr/local/etc/pure-ftpd.conf

############################################################
#                                                          #
#         Configuration file for pure-ftpd wrappers        #
#                                                          #
############################################################

# If you want to run Pure-FTPd with this configuration   
# instead of command-line options, please run the
# following command :
#
# /usr/local/sbin/pure-config.pl /usr/local/etc/pure-ftpd.conf
#
# Please don't forget to have a look at documentation at
# http://www.pureftpd.org/documentation.shtml for a complete list of
# options.

# Cage in every user in his home directory

ChrootEveryone              yes
# chroot每一个用户,等同于Proftpd 中的DefaultRoot~ , 可以限制用户在某个地方活动,增
# 强服务器的安全性。使用户不能通过cd命令进入上一级目录。


# If the previous option is set to "no", members of the following group
# won't be caged. Others will be. If you don't want chroot()ing anyone,
# just comment out ChrootEveryone and TrustedGID.

# TrustedGID                    100
#以上两者要一起用


# Turn on compatibility hacks for broken clients

BrokenClientsCompatibility  no



# Maximum number of simultaneous users

MaxClientsNumber            50
#最大链接数


# Fork in background

Daemonize                   yes
#Fork in background 以守护进程方式在后台运行


# Maximum number of sim clients with the same IP address

MaxClientsPerIP             8
#每个ip最多链接数,最好设小点。


# If you want to log all client commands, set this to "yes".
# This directive can be duplicated to also log server responses.

VerboseLog                  no
#是否要把所有client端的指令都log下来


# List dot-files even when the client doesn't send "-a".

DisplayDotFiles             yes
#显示开头的文件


# Don't allow authenticated users - have a public anonymous FTP only.

AnonymousOnly               no
#是否只让匿名登录


# Disallow anonymous connections. Only allow authenticated users.

NoAnonymous                 no
#不开放匿名登入


# Syslog facility (auth, authpriv, daemon, ftp, security, user, local*)
# The default facility is "ftp". "none" disables logging.

SyslogFacility              ftp
# 应该是对日志做一下过滤 (auth, authpriv, daemon, ftp, security, user, local*)可以让日志只
# 记录想要的信息


# Display fortune cookies

# FortunesFile              /usr/share/fortune/zippy



# Don't resolve host names in log files. Logs are less verbose, but
# it uses less bandwidth. Set this to "yes" on very busy servers or
# if you don't have a working DNS.

DontResolve                 yes
#不反向解释客户端的ip


# Maximum idle time in minutes (default = 15 minutes)

MaxIdleTime                 15
#最大闲置时间(分钟)


# LDAP configuration file (see README.LDAP)

# LDAPConfigFile                /etc/pureftpd-ldap.conf
#使用LDAP认证


# MySQL configuration file (see README.MySQL)

# MySQLConfigFile               /etc/pureftpd-mysql.conf
#使用MySQL认证  注意:配置文件的正确路径

# Postgres configuration file (see README.PGSQL)

# PGSQLConfigFile               /etc/pureftpd-pgsql.conf
#使用PGSQL认证

# PureDB user database (see README.Virtual-Users)

# PureDB                        /etc/pureftpd.pdb
#使用者资料的DB存放地点 [由于我是用PureFTPD的內建DB.固有此选项

# Path to pure-authd socket (see README.Authentication-Modules)


# ExtAuth                       /var/run/ftpd.sock
#pure-authd socket 路径 (详细请看 README.Authentication-Modules)


# If you want to enable PAM authentication, uncomment the following line

# PAMAuthentication             yes
#开启PAM认证


# If you want simple Unix (/etc/passwd) authentication, uncomment this

# UnixAuthentication            yes
#如果你想要有简单的Unix(/etc/passwd)的认证


# Please note that LDAPConfigFile, MySQLConfigFile, PAMAuthentication and
# UnixAuthentication can be used only once, but they can be combined
# together. For instance, if you use MySQLConfigFile, then UnixAuthentication,
# the SQL server will be asked. If the SQL authentication fails because the
# user wasn't found, another try # will be done with /etc/passwd and
# /etc/shadow. If the SQL authentication fails because the password was wrong,
# the authentication chain stops here. Authentication methods are chained in
# the order they are given.



# 'ls' recursion limits. The first argument is the maximum number of
# files to be displayed. The second one is the max subdirectories depth

LimitRecursion              2000 8
#ls最多列出2000个文件.最深8层


# Are anonymous users allowed to create new directories ?

AnonymousCanCreateDirs      no
#匿名用户可以创建目录


# If the system is more loaded than the following value,
# anonymous users aren't allowed to download.


MaxLoad                     4
#当system load超过4時.使用者将不能再下载


# Port range for passive connections replies. - for firewalling.

# PassivePortRange          30000 50000
#被动连接应答范围


# Force an IP address in PASV/EPSV/SPSV replies. - for NAT.
# Symbolic host names are also accepted for gateways with dynamic IP
# addresses.

# ForcePassiveIP                192.168.0.1



# Upload/download ratio for anonymous users.

# AnonymousRatio                1 10
# Anonymous连接上传/下载比率


# Upload/download ratio for all users.
# This directive superscedes the previous one.

# UserRatio                 1 10
# 用户上传/下载比率(注:如果使用ldap,mysql,pgsql,pam不要启用该功能,否则你在ldap
# 等中设置的Ratio无校)


# Disallow downloading of files owned by "ftp", ie.
# files that were uploaded but not validated by a local admin.

AntiWarez                   yes
#上传的文件不能被下载(owner is ftp).等到local admin确认


# IP address/port to listen to (default=all IP and port 21).

# Bind                      127.0.0.1,21
#要绑定和ip/port,在你的系统中有两个FTP Server这样你其中一个FTP就要使用其它端口。
#格式-> 127.0.0.1,21 如果只写port表All ip,port


# Maximum bandwidth for anonymous users in KB/s

# AnonymousBandwidth            8
#Anonymous 带宽,单位KB/s


# Maximum bandwidth for *all* users (including anonymous) in KB/s
# Use AnonymousBandwidth *or* UserBandwidth, both makes no sense.

# UserBandwidth             8
#用户带宽,单位KB/s


# File creation mask. <umask for files>:<umask for dirs> .
# 177:077 if you feel paranoid.

Umask                       133:022
#上传文件的Umask.(<umask for files>:<umask for dirs> )


# Minimum UID for an authenticated user to log in.

MinUID                      100
# UID至少多少才能登录


# Allow FXP transfers for authenticated users.

AllowUserFXP                no
#支不支持FXP


# Allow anonymous FXP for anonymous and non-anonymous users.

AllowAnonymousFXP           no
#Anonymous支不支持FXP


# Users can't delete/write files beginning with a dot ('.')
# even if they own them. If TrustedGID is enabled, this group
# will have access to dot-files, though.

ProhibitDotFilesWrite       no
#(”.”)开头的文件能不能被读/写,UNIX Like下以点开头的文件%

论坛徽章:
0
18 [报告]
发表于 2006-06-20 11:45 |只看该作者
# the SQL server will be asked. If the SQL authentication fails because the
# user wasn't found, another try # will be done with /etc/passwd and
# /etc/shadow. If the SQL authentication fails because the password was wrong,
# the authentication chain stops here. Authentication methods are chained in
# the order they are given.



# 'ls' recursion limits. The first argument is the maximum number of
# files to be displayed. The second one is the max subdirectories depth

LimitRecursion              2000 8
#ls最多列出2000个文件.最深8层


# Are anonymous users allowed to create new directories ?

AnonymousCanCreateDirs      no
#匿名用户可以创建目录


# If the system is more loaded than the following value,
# anonymous users aren't allowed to download.


MaxLoad                     4
#当system load超过4時.使用者将不能再下载


# Port range for passive connections replies. - for firewalling.

# PassivePortRange          30000 50000
#被动连接应答范围


# Force an IP address in PASV/EPSV/SPSV replies. - for NAT.
# Symbolic host names are also accepted for gateways with dynamic IP
# addresses.

# ForcePassiveIP                192.168.0.1



# Upload/download ratio for anonymous users.

# AnonymousRatio                1 10
# Anonymous连接上传/下载比率


# Upload/download ratio for all users.
# This directive superscedes the previous one.

# UserRatio                 1 10
# 用户上传/下载比率(注:如果使用ldap,mysql,pgsql,pam不要启用该功能,否则你在ldap
# 等中设置的Ratio无校)


# Disallow downloading of files owned by "ftp", ie.
# files that were uploaded but not validated by a local admin.

AntiWarez                   yes
#上传的文件不能被下载(owner is ftp).等到local admin确认


# IP address/port to listen to (default=all IP and port 21).

# Bind                      127.0.0.1,21
#要绑定和ip/port,在你的系统中有两个FTP Server这样你其中一个FTP就要使用其它端口。
#格式-> 127.0.0.1,21 如果只写port表All ip,port


# Maximum bandwidth for anonymous users in KB/s

# AnonymousBandwidth            8
#Anonymous 带宽,单位KB/s


# Maximum bandwidth for *all* users (including anonymous) in KB/s
# Use AnonymousBandwidth *or* UserBandwidth, both makes no sense.

# UserBandwidth             8
#用户带宽,单位KB/s


# File creation mask. <umask for files>:<umask for dirs> .
# 177:077 if you feel paranoid.

Umask                       133:022
#上传文件的Umask.(<umask for files>:<umask for dirs> )


# Minimum UID for an authenticated user to log in.

MinUID                      100
# UID至少多少才能登录


# Allow FXP transfers for authenticated users.

AllowUserFXP                no
#支不支持FXP


# Allow anonymous FXP for anonymous and non-anonymous users.

AllowAnonymousFXP           no
#Anonymous支不支持FXP


# Users can't delete/write files beginning with a dot ('.')
# even if they own them. If TrustedGID is enabled, this group
# will have access to dot-files, though.

ProhibitDotFilesWrite       no
#(”.”)开头的文件能不能被读/写,UNIX Like下以点开头的文件是隐藏文件ls –a才能列出
#Pureftpd Quota模式下做产生” .ftpquota”文件。


# Prohibit *reading* of files beginning with a dot (.history, .ssh...)

ProhibitDotFilesRead        no
#(”.”)开头的文件能不能被读/写,UNIX Like下以点开头的文件是隐藏文件ls –a才能列出
#Pureftpd Quota模式下做产生” .ftpquota”文件。


# Never overwrite files. When a file whoose name already exist is uploaded,
# it get automatically renamed to file.1, file.2, file.3, ...

AutoRename                  no
#上传文件若有相同文件名自动改名(file.1,file.2...)


# Disallow anonymous users to upload new files (no = upload is allowed)

AnonymousCantUpload         no
#匿名用户上传文件


# Only connections to this specific IP address are allowed to be
# non-anonymous. You can use this directive to open several public IPs for
# anonymous FTP, and keep a private firewalled IP for remote administration.
# You can also only allow a non-routable local IP (like 10.x.x.x) to
# authenticate, and keep a public anon-only FTP server on another IP.

#TrustedIP                  10.1.1.1
#锁IP


# If you want to add the PID to every logged line, uncomment the following
# line.

#LogPID                     yes
#Log文件添加PID


# Create an additional log file with transfers logged in a Apache-like format :
# fw.c9x.org - jedi [13/Dec/1975:19:36:39] "GET /ftp/linux.tar.bz2" 200 21809338
# This log file can then be processed by www traffic analyzers.

# AltLog                     clf:/var/log/pureftpd.log
#log存放地点,注日志有几种常用的格式
#clf 类似apache格式,stats UNIX log格式,w3c 标准W3C格式,可能是HTML格式


# Create an additional log file with transfers logged in a format optimized
# for statistic reports.

# AltLog                     stats:/var/log/pureftpd.log
#log存放地点,注日志有几种常用的格式
#clf 类似apache格式,stats UNIX log格式,w3c 标准W3C格式,可能是HTML格式


# Create an additional log file with transfers logged in the standard W3C
# format (compatible with most commercial log analyzers)

# AltLog                     w3c:/var/log/pureftpd.log

论坛徽章:
0
19 [报告]
发表于 2006-06-20 11:46 |只看该作者
#log存放地点,注日志有几种常用的格式
#clf 类似apache格式,stats UNIX log格式,w3c 标准W3C格式,可能是HTML格式


# Disallow the CHMOD command. Users can't change perms of their files.

#NoChmod                     yes
#不给chmod指令的权限



# Allow users to resume and upload files, but *NOT* to delete them.

#KeepAllFiles                yes
#使用者可续传.但不可刪除文件


# Automatically create home directories if they are missing

#CreateHomeDir               yes
#如果user的home不存在自动建立(我把这个设为YES)


# Enable virtual quotas. The first number is the max number of files.
# The second number is the max size of megabytes.
# So 1000:10 limits every user to 1000 files and 10 Mb.

#Quota                       1000:10
#Quota <文件数>:<容量Megabytes >,FTP限制10M空间,可以上传1000个文件(注:如
#果使用ldap,mysql,pgsql,pam不要启用该功能,否则你在ldap等中设置的Quota无校)


# If your pure-ftpd has been compiled with standalone support, you can change
# the location of the pid file. The default is /var/run/pure-ftpd.pid

#PIDFile                     /var/run/pure-ftpd.pid
#记录pure-ftpd的PID文件


# If your pure-ftpd has been compiled with pure-uploadscript support,
# this will make pure-ftpd write info about new uploads to
# /var/run/pure-ftpd.upload.pipe so pure-uploadscript can read it and
# spawn a script to handle the upload.

#CallUploadScript yes
#呼叫UploadScript


# This option is useful with servers where anonymous upload is
# allowed. As /var/ftp is in /var, it save some space and protect
# the log files. When the partition is more that X percent full,
# new uploads are disallowed.

MaxDiskUsage               99
#当硬盘使用率到多少時将停止上传


# Set to 'yes' if you don't want your users to rename files.

#NoRename                  yes
#用户不能重命名文件名


# Be 'customer proof' : workaround against common customer mistakes like
# 'chmod 0 public_html', that are valid, but that could cause ignorant
# customers to lock their files, and then keep your technical support busy
# with silly issues. If you're sure all your users have some basic Unix
# knowledge, this feature is useless. If you're a hosting service, enable it.

CustomerProof              yes



# Per-user concurrency limits. It will only work if the FTP server has
# been compiled with --with-peruserlimits (and this is the case on
# most binary distributions) .
# The format is : <max sessions per user>:<max anonymous sessions>
# For instance, 3:20 means that the same authenticated user can have 3 active
# sessions max. And there are 20 anonymous sessions max.

# PerUserLimits            3:20
#<每个账号最多可登入几次:Anonymous最多可同時登入几次>


# When a file is uploaded and there is already a previous version of the file
# with the same name, the old file will neither get removed nor truncated.
# Upload will take place in a temporary file and once the upload is complete,
# the switch to the new version will be atomic. For instance, when a large PHP
# script is being uploaded, the web server will still serve the old version and
# immediatly switch to the new one as soon as the full file will have been
# transfered. This option is incompatible with virtual quotas.

# NoTruncate               yes



# This option can accept three values :
# 0 : disable SSL/TLS encryption layer (default).
# 1 : accept both traditional and encrypted sessions.
# 2 : refuse connections that don't use SSL/TLS security mechanisms,
#     including anonymous sessions.
# Do _not_ uncomment this blindly. Be sure that :
# 1) Your server has been compiled with SSL/TLS support (--with-tls),
# 2) A valid certificate is in place,
# 3) Only compatible clients will log in.

# TLS                      1



# Listen only to IPv4 addresses in standalone mode (ie. disable IPv6)
# By default, both IPv4 and IPv6 are enabled.

# IPV4Only                 yes



# Listen only to IPv6 addresses in standalone mode (ie. disable IPv4)
# By default, both IPv4 and IPv6 are enabled.

# IPV6Only                 yes

# UTF-8 support for file names (RFC 2640)
# Define charset of the server filesystem and optionnally the default charset
# for remote clients if they don't use UTF-8.
# Works only if pure-ftpd has been compiled with --with-rfc2640

# FileSystemCharset        big5
# ClientCharset                big5

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

论坛徽章:
0
20 [报告]
发表于 2006-06-20 11:47 |只看该作者
###############################################################################


#################################启动pure-ftpd##################################
/usr/local/sbin/pure-config.pl /usr/local/etc/pure-ftpd.conf
也可以通过
/usr/local/etc/rc.d/pure-ftpd.sh start

提示一下信息证明pure-ftpd已经工作
Running: /usr/local/sbin/pure-ftpd -A -c50 -B -C8 -D -E -fftp -H -I15  
-lmysql:/usr/local/etc/pureftpd-mysql.conf -L2000:8 -m4 -Q1:10 -s -U133:022  
-u100 -Ow3c:/var/log/pureftpd.log -j -k99 -Z




#################################测试pureftp####################################
ftp 192.168.0.205
Connected to 192.168.0.205.
220---------- 欢迎来到 Pure-FTPd [TLS] ----------
220-您是第 1 个使用者,最多可达 50 个连接
220-现在本地时间是 13:17。服务器端口: 21。
220-这是私人系统 - 不开放匿名登录
220-这部主机也欢迎IPv6的连接
220 在 15 分钟内没有活动,您被会断线。
Name (192.168.0.205:chb):
输入用户名、密码
##############################设置ftp管理的虚拟主机############################
ee /usr/local/etc/apache/httpd.conf

添加

<VirtualHost 192.168.0.205>
DocumentRoot "/home/chb/ftp"
ServerName www.chb.com
<Directory "/home/chb/ftp">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

#######################增加二级登陆密码以增强安全性############################


ee /web/ftp/.htaccess
添加以下内容

AuthType Basic
AuthUserFile /usr/local/etc/pureftpd.passwd
AuthName  FTP服务器后台管理登陆界面
require valid-user
satisfy any

cd /web/chinaPHP_Manager/ftp
chown www .htaccess
chmod 644 .htaccess

touch pureftpd.passwd

htpasswd -bc /usr/local/etc/pureftpd.passwd name password
chmod 644 /usr/local/etc/pureftpd.passwd




###################################增加ftp启动项###############################
ee /etc/rc.conf
添加
pureftpd_enable="YES"
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP