51/AVR单片机技术驿站!  <在线翻译> ┆    便利工具    特色网址  ┆ 无弹窗、无插件的绿色站点...  英才招聘   学历查询 ┆ 喜欢>>收藏我站 

当前位置:首页 > ARM/CPLD/综合 > 详细内容
RHEL4.0+Pureftp+Webpureftp+Mysql+Zend
发布时间:2009/7/23  阅读次数:791  字体大小: 【小】 【中】【大】

RHEL4.0+Pureftp+Webpureftp+Mysql+Zend Optimizer实现一个功能较全面的FTP服务系统:

实验环境:
本实验的环境采取系统是RHEL4.0以及上面所提到的相关软件;
构成简单的C/S系统,其中RHEL4.0除了成为FTP服务器之外还充当DNS服务器以及WEB服务器角色。
服务器IP地址为:192.168.1.10,FQDN为server.jerrywjl.com,客户端为WindowsXP,IP地址为192.168.1.1

以下为实验步骤:
首先配置基本的网络参数以及相关的FTP和WEB服务,配置的目的是实现三个解析:
server.jerrywjl.com、ftp.jerrywjl.com、www.jerrywjl.com
这个过程比较简单,所以具体步骤在实验中略过,只是强调一下步骤:
1.配置主机名称FQDN;
2.配置主机TCP/IP服务以及DNS服务以及启动DNS服务;
3.配置并启动Apache服务
在Apache主配置文档中更改下面两处:
在原来AddDefaultCharset UTF-8下添加一行——AddDefaultCharset GB2312;
将文档中的主机名更改为ftp.jerrywjl.com;
最后保存并启动服务进行http服务测试。

配置完成之后,基本环境算是准备完成,现在安装Mysql并且进行Mysql服务配置与测试:
首先装Mysql的软件包:
[root@server RPMS]# rpm -ihv --aid mysql-server-4.1.7-4.RHEL4.1.i386.rpm
[root@server RPMS]# rpm -ihv --aid mysqlclient10-*
[root@server RPMS]# rpm -ihv --aid mysql-devel-4.1.7-4.RHEL4.1.i386.rpm
[root@server RPMS]# rpm -ihv --aid php-mysql-4.3.9-3.1.i386.rpm

完成之后启动服务,并且设置Mysql服务器密码以及进行登录测试:
[root@server ~]# service mysqld start
Initializing MySQL database:    [    OK    ]
Starting MySQL:    [    OK    ]
[root@server ~]# chkconfig mysqld on
[root@server ~]# mysqladmin -u root password 123456
[root@server ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.    Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.1.7

Type help; or \h for help. Type \c to clear the buffer.

mysql> show databases;
+-------------+
| Database          |
+-------------+
| mysql                   |
| test                     |
+-------------+
2 rows in set (0.00 sec)

mysql> quit
Bye
[root@server ~]#

下面开始安装pure-ftpd服务软件,在此之前,首先获取所有的试验中需要的软件包:
这就是实验所需要的软件:
[root@server ~]# cd /usr/local/packages/
[root@server packages]# ls
pure-ftpd-1.0.20.tar.gz    webpureftp0.1.tar.gz    ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz
[root@server packages]# ll
total 4656
-rwxr-xr-x    1 root root    561412 Mar 21 22:30 pure-ftpd-1.0.20.tar.gz
-rwxr-xr-x    1 root root    196917 Mar 21 22:30 webpureftp0.1.tar.gz
-rwxr-xr-x    1 root root 3973599 Mar 21 22:30 ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz
先安装pure-ftpd:
[root@server packages]# mkdir temp
[root@server packages]# tar -zxf pure-ftpd-1.0.20.tar.gz -C temp/
[root@server packages]#
[root@server packages]# cd temp/pure-ftpd-1.0.20/
[root@server pure-ftpd-1.0.20]#
[root@server pure-ftpd-1.0.20]# cd

[root@server ~]# vi install_pureftpd                                                 ————这是pureftpd的安装脚本
内容如下:
cd /usr/local/packages/temp/pure-ftpd-1.0.20                          ————解压后pureftp所在的目录
./configure \
--prefix=/usr/local/pureftpd \                                                                 ————指定安装目录
--with-mysql \                                                                                                ————支持使用Mysql保存虚拟帐号
--with-virtualchroot \                                                                                 ————可以使用户在自己主目录下通过添加符号链接的方式访问其他原本
                                                                                                                                                  不允许chroot的目录
--with-virtualhosts \                                                                                     ————允许虚拟主机
--with-virtualroot \                                                                                      ————支持虚拟root根目录
--with-diraliases \                                                                                          ————支持目录别名
--with-uploadscript \                             ————支持当一个上传完成之后,自动启用额外程序和脚本
--with-cookie \                                         ————支持当用户登录时显示定制信息
--with-quotas \                                        ————开启磁盘配额功能
--with-sysquotas \                                  ————允许使用操作系统磁盘配额
--with-ratios \                                            ————支持上传/下载比例
--with-throttling \                                   ————支持带宽限制
--with-largefile \                                       ————支持下载大于2G文件
--with-peruserlimits \                             ————开启限制同一个帐号可以同时登录的个数
--with-paranoidmsg \                          ————无论何种原因登录失败都显示失败原因
--with-welcomemsg \                             ———— 显示欢迎信息
--with-language=simplified-chinese                                                      ————使用简体中文作为软件界面
完成之后保存退出,给予该文件可执行文件,并且按照脚本方式来执行安装操作。
[root@server ~]# chmod 755 install_pureftpd
[root@server ~]# ./install_pureftpd
上述操作执行了编译前的环境配置,如下:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
…………………………………………………………………
configure: You have /dev/urandom - Great
configure: You have /dev/random - Great
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating pam/Makefile
config.status: creating man/Makefile
config.status: creating gui/Makefile
config.status: creating configuration-file/Makefile
config.status: creating contrib/Makefile
config.status: creating m4/Makefile
config.status: creating configuration-file/pure-ftpd.conf
config.status: creating configuration-file/pure-config.pl
config.status: creating configuration-file/pure-config.py
config.status: creating puredb/Makefile
config.status: creating puredb/src/Makefile
config.status: creating pure-ftpd.spec
config.status: creating config.h
config.status: executing depfiles commands
configure: +--------------------------------------------------------------------------+
configure: | You can subscribe to the Pure-FTPd users mailing-list                                                      |
configure: | to ask for help and to stay informed of new releases.                                                       |
configure: | Go to http://www.pureftpd.org/ml/ now!                                                                                 |
configure: +--------------------------------------------------------------------------+

进入指定目录进行编译并且安装:
[root@server ~]# cd /usr/local/packages/temp/pure-ftpd-1.0.20/
[root@server ~]# cd /usr/local/packages/temp/pure-ftpd-1.0.20/
[root@server pure-ftpd-1.0.20]# make
[root@server pure-ftpd-1.0.20]# make install
生成配置脚本:
[root@server pure-ftpd-1.0.20]# cp configuration-file/pure-config.pl /usr/local/pureftpd/sbin/
更改配置脚本权限:
[root@server pure-ftpd-1.0.20]# chmod +x /usr/local/pureftpd/sbin/pure-config.pl
生成ftp的服务主目录:
[root@server pure-ftpd-1.0.20]# mkdir /ftproot
以下要生成pure-ftp服务管理脚本:
[root@server pure-ftpd-1.0.20]# cd contrib/
[root@server contrib]# vi redhat.init
将其中下面的语句:
fullpath=/usr/local/sbin/$prog
pureftpwho=/usr/local/sbin/pure-ftpwho
更改为:
fullpath=/usr/local/pureftpd/sbin/$prog
pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho
将该文件复制到/etc/init.d目录中并且重命名为pure-ftpd
[root@server contrib]# cp redhat.init /etc/init.d/pure-ftpd
并且更改该文件为可执行:
[root@server contrib]# chmod +x /etc/init.d/pure-ftpd
将该服务添加到启动服务列表并配置该服务随系统启动而启动:
[root@server contrib]# chkconfig --add pure-ftpd
[root@server contrib]# chkconfig pure-ftpd on
由于pure-ftpd将FTP匿名用户映射到名为ftp的系统帐号,所以ftp系统帐号的主目录就是FTP匿名用户的主目录。如果需要FTP服务器允许匿名登录,就需要建立一个名为ftp的系统帐号,而且该帐号的主目录必须存在。默认情况下pure-ftpd安装的时候已经建立了ftp帐号,但是该帐号默认的主目录/var/ftp不存在,所以要建立/var/ftp,但是如果系统中已经安装vsftp服务的话,该目录会自动建立。因为如果希望FTP匿名用户能够上传文件,就保证ftp系统帐号对主目录有写入权限:
[root@server contrib]# chown ftp.ftp /var/ftp

现在开始安装对pure-ftpd进行管理的基于web的管理工具webpureftp,但是因为该软件的PHP源代码使用了ZendEncode进行了加密,所以需要安装Zend Oprimizer才可以执行webpureftp目录中加密的PHP程序。否则会出现乱码。因此现在安装ZendEncode:
[root@server ~]# cd /usr/local/packages/
[root@server packages]# ls
pure-ftpd-1.0.20.tar.gz    webpureftp0.1.tar.gz
temp                                   ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz
[root@server packages]# tar -zxf ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz -C temp/
[root@server packages]# cd temp/ZendOptimizer-2.5.10a-linux-glibc21-i386/
[root@server ZendOptimizer-2.5.10a-linux-glibc21-i386]# ./install.sh
通过上述操作,会有一个安装向导,建议接受全部的默认条件:
1.是否接受协议————是
2.Zend安装目录是否/usr/local/Zend————是
3.确认php.ini配置文件是否在/etc/目录中————是
4.是否使用Apache作为默认的WEB服务器————是
5.Apache默认的控制路径是否是/usr/sbin/apachectl目录————是
6.是否重启Apache服务————是

注意这里的提示:
The following configuration changes have been made:                                   
                   x - The php.ini file has been relocated from /etc to /usr/local/Zend/etc    x
                   x - A symbolic link for the php.ini file has been created in /etc.              x
                   x - The original php.ini was backed up to /etc/php.ini-zend_optimizer.bak              x
在上述的完成过程中,可能会碰到Zend Optimizer与SELinux的配合问题。
主要因为Zend在安装时需要修改/etc/php.ini文件的内容,并将该文件替换为一个符号链接文件,指向/usr/local/Zend/etc/php.ini,所以造成Apache服务器在每次启动都会违反SELinux的规则出错。
解决的方法有两种:

第一种:在整个配置之前关闭SELinux:
[root@server ~]# vi /etc/sysconfig/selinux
针对下面的内容:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#           enforcing - SELinux security policy is enforced.
#           permissive - SELinux prints warnings instead of enforcing.
#           disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
#           targeted - Only targeted network daemons are protected.
#           strict - Full SELinux protection.
SELINUXTYPE=targeted
将SELINUX=enforcing更改为SELINUX=disabled并且重新启动系统

第二种:在没有更改该配置文件情况下使用下面命令设置文件相关安全属性:
[root@server ~]# rm -f /etc/php.ini
[root@server ~]# cp /usr/local/Zend/etc/php.ini /etc/
[root@server ~]# chcon -u system_u /etc/php.ini
[root@server ~]# chcon -t shlib_t /usr/local/Zend/lib/ZendExtensionManager.so
[root@server ~]# chcon -t shlib_t /usr/local/Zend/lib/Optimizer-2.5.10/php-4.3.x/ZendOptimizer.so

下面开始生成Mysql数据库,通过webpureftp软件的安装可以实现管理pure-ftpd和mysql结构中的php帐户,方法如下:
[root@server ~]# cd /usr/local/packages/
[root@server packages]# tar -zxf webpureftp0.1.tar.gz -C temp/

下面开始对主配置文件进行修改:
[root@server ~]# cd /usr/local/packages/
[root@server packages]# tar -zxf webpureftp0.1.tar.gz -C temp/
[root@server packages]# cd temp/webpureftp0.1/
[root@server webpureftp0.1]#
[root@server webpureftp0.1]# vi SQL/pureftp_0.1.sql
找到DROP TABLE IF EXISTS `depart_info`;这句,在前面加上:
CREATE DATABASE pureftp;
USE pureftp;


那么整段成为:
CREATE DATABASE pureftp;
USE pureftp;
DROP TABLE IF EXISTS `depart_info`;
CREATE TABLE `depart_info` (
    `id` int(4) NOT NULL auto_increment,
    `name` varchar(30) NOT NULL default ,
    PRIMARY KEY    (`id`),
    KEY `id` (`id`)
) TYPE=MyISAM AUTO_INCREMENT=21 ;
保存退出。
最后执行命令生成mysql数据库:

[root@server webpureftp0.1]# mysql -u root -p < SQL/pureftp_0.1.sql
Enter password:
[root@server webpureftp0.1]#

测试:
[root@server webpureftp0.1]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.    Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 4.1.7

Type help; or \h for help. Type \c to clear the buffer.

mysql> show databases;
+-------------+
| Database         |
+-------------+
| mysql                |
| pureftp              |
| test                    |
+-------------+
3 rows in set (0.01 sec)

mysql> use pureftp;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+------------------------+
| Tables_in_pureftp               |
+------------------------+
| depart_info                              |
| ftp_users                                  |
| ftp_users_info                        |
| user_info                                   |
+------------------------+
4 rows in set (0.00 sec)

mysql> quit
Bye
[root@server webpureftp0.1]#



现在修改pure-ftpd的主配置文件
[root@server webpureftp0.1]# cd docs/
[root@server docs]# vi pureftpd-mysql.conf,更改下列语句:
将:
MYSQLUser           network              更改为:              MYSQLUser           root
将:
MYSQLPassword     123456              更改为:              MYSQLPassword     123456
(由于我这里就是使用123456,所以不改)

将:
MYSQLDatabase     network                                        更改为:              MYSQLDatabase     pureftp

完成之后复制下面两个文件到/etc/目录下:
[root@server docs]# cp pure-ftpd.conf /etc
[root@server docs]# cp pureftpd-mysql.conf /etc

最后一步,开始配置webpureftp,进入webpureftp解压目录,也就是刚才的webpureftp0.1编辑config子目录中的config.inc.php文件,将其中的路径修改是实际路径,将口令也修改为实际口令:
[root@server docs]# pwd
/usr/local/packages/temp/webpureftp0.1/docs
[root@server docs]# cd ..
[root@server webpureftp0.1]# vi config/config.inc.php
下面是原来未修改的内容:
$orig_title = Web PureFTP¹Ü�ìϵͳ;

$pagesize=20;
$topsize[0]=8;
$topsize[1]=10;
$topsize[2]=15;
$topsize[3]=20;
$;

$default_ftp_root=/data/ftp;

$obj_db=new db(localhost,root,,pureftp);
?>
更改为以下内容:
$orig_title = Web PureFTP¹Ü�ìϵͳ;

$pagesize=20;
$topsize[0]=8;
$topsize[1]=10;
$topsize[2]=15;
$topsize[3]=20;
$;

$default_ftp_root=/ftproot;

$obj_db=new db(localhost,root,123456,pureftp);
?>
保存退出,并将整个的目录拷贝到apache服务器的服务目录下,进行重命名:
[root@server webpureftp0.1]# cd ..
[root@server temp]# cp -a webpureftp0.1/ /var/www/html/webpureftp
[root@server temp]#

现在进行实际的测试:
首先使用客户端进行登录测试:http://www.jerrywjl.com/webpureftp(当然客户端要作DNS指向)
若出现登录页面,使用默认的管理员帐号admin以及密码admin就可以进入这套管理系统:

该管理系统主要实现帐号的添加以及管理工作,至于pure-ftp的操作,还必须要修改该服务的主配置文件,并且启动该服务。Pure-ftp的服务配置文件在/etc/pure-ftpd.conf中。
针对该配置文件,可以作如下更改:
[root@server temp]# vi /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/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf
#
# Please dont forget to have a look at documentation at
# http://www.pureftpd.org/documentation.html for a complete list of
# options.

# Cage in every user in his home directory

ChrootEveryone                        yes                          ————是否将所有用户锁定到自身目录中

# If the previous option is set to no, members of the following group
# wont be caged. Others will be. If you dont 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


# 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


# List dot-files even when the client doesnt send -a.

DisplayDotFiles                     yes


# Dont 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


# Display fortune cookies

# FortunesFile                        /usr/share/fortune/zippy                         
FortunesFile                    /etc/ftpmsg                          ————设置欢迎信息文件位置


# Dont 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 dont have a working DNS.

DontResolve                             yes
              

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

MaxIdleTime                             15                          ————设置用户空隙那时间超过限制


# LDAP configuration file (see README.LDAP)

# LDAPConfigFile                          /etc/pureftpd-ldap.conf


# MySQL configuration file (see README.MySQL)

MySQLConfigFile                         /etc/pureftpd-mysql.conf


# Postgres configuration file (see README.PGSQL)

# PGSQLConfigFile                         /etc/pureftpd-pgsql.conf


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

# PureDB                                        /etc/pureftpd.pdb


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

# ExtAuth                                       /var/run/ftpd.sock


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

# PAMAuthentication                     yes


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

# UnixAuthentication                    yes


# 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 wasnt 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

# Are anonymous users allowed to create new directories ?

AnonymousCanCreateDirs          no                          ————是否允许匿名用户建立目录

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

MaxLoad                                   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


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

# UserRatio                             1 10


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

AntiWarez                               yes                          ————是否允许下载由匿名用户上传的文件


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

# Bind                                    127.0.0.1,21                          ————设置服务器绑定的地址和端口


# Maximum bandwidth for anonymous users in KB/s

# AnonymousBandwidth                    8                          ————设置匿名用户可以使用的带宽

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

# UserBandwidth                     8                          ————设置本地用户可以使用的带宽


# File creation mask. : .
# 177:077 if you feel paranoid.

Umask                                       133:022


# Minimum UID for an authenticated user to log in.

MinUID                                    100

# Allow FXP transfers for authenticated users only.

AllowUserFXP                          yes

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

AllowAnonymousFXP                   no

# Users cant 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


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

ProhibitDotFilesRead              no


# 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


# 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


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

LogPID                                   yes

# 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:/tmp/pureftpd.log


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

#AltLog                                   stats:/tmp/pureftpd.log


# 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

# Disallow the CHMOD command. Users cant change perms of their files.

#NoChmod                                   yes

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

#KeepAllFiles                          yes

# Automatically create home directories if they are missing

CreateHomeDir                         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


# 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


# 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

# 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 dont 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 youre sure all your users have some basic Unix
# knowledge, this feature is useless. If youre 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 : :
# 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                          设置每个用户最大并发连接数

# 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 dont 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

对该文件修改完毕后重启服务:
[root@server temp]# /etc/init.d/pure-ftpd start
Starting pure-config.pl: Running: /usr/local/pureftpd/sbin/pure-ftpd --daemonize -A -c50 -B -C8 -D -fftp -F/etc/ftpmsg -H -I15 -lmysql:/etc/pureftpd-mysql.conf -L2000:8 -m4 -s -U133:022 -u100 -w -1 -j -k99 -Z

[root@server temp]# chkconfig pure-ftpd on
[root@server temp]#
此时使用命令行进行访问测试,会出现下列窗口:
[root@server temp]# ftp
ftp> open 192.168.1.10
Connected to 192.168.1.10.
220---------- »¶Ó¬À´µ½ Pure-FTPd ----------
220-ÄúÊÇµÚ 1 ¸öʹÓÃÕߣ¬×î¶à¿É´ï 50 ¸öÁ¬½Ó
220-ÏÖÔÚ±¾µØÊ±¼äÊÇ 00:05¡£•þÎñÆ÷¶Ë¿Ú£º 21¡£
220-ÕⲿÖ÷»úÒ²»¶Ó¬IPv6µÄÁ¬½Ó
220 ÔÚ 15 •ÖÖÓÄÚûÓл£¬Äú±»»á¶ÏÏß¡£
500 °²È«À©³äÏîδʵʩ
500 °²È«À©³äÏîδʵʩ
KERBEROS_V4 rejected as an authentication type
Name (192.168.1.10:root):
可以使用匿名帐号登录服务器。

我要评论
  • 匿名发表
  • [添加到收藏夹]
  • 发表评论:(匿名发表无需登录,已登录用户可直接发表。) 登录状态:未登录
最新评论
所有评论[0]
    暂无已审核评论!

┊ 网站导航 ┊ 管理登陆 ┊ 免责声明 ┊ 问题反馈 ┊ 友链说明┊
本站部分内容来自网络共享资源,如有冒犯您的权利请来信告之删除或纠正!
不得对本站进行复制、盗链或镜像,转载内容须获得同意或授权;欢迎友情链接、站务合作!

    我要报警 Alexa
 mcusy_cn#126.com (请把#改成@) 交流:522422171
本站学习交流群:138..158(高级群1-满)、77930286(高级群2)、61804809(群3)
Copyright© MCUSY All Rights Reserved
本站网警备案号: WZ36040002485
  ICP备案证书号:粤ICP备09034963号