http://www.proftpd.org/下载最新版本1.将刚刚下载的proftpd解压缩:[root@tetroot]#wget\http://ftp.nsysu.edu.tw/Unix/FTP/proftpd/distrib/source/proftpd-1.3.3.tar.gz[root@testroot]#
http://www.
proftpd.org/
下载最新版本
1.将刚刚下载的proftpd解压缩:
[root@tet root]# wget \
>
http://ftp.nsysu.edu.tw/Unix/FTP/proftpd/distrib/source/proftpd-1.3.3.tar.
gz
[root@test root]# cd /usr/local/src
[root@test src]# tar -zxvf /root/proftpd-1.3.3.tar.gz
# ...(略)...会主动产生proftpd-1.3.3的目录
[root@test src]# cd proftpd-1.3.3
#在这个目录底下的 INSTALL 请详细的阅读,里面有安装的几个重要资讯!
2.进行编译前的参数设定:
[root@test proftpd-1.3.3]# ./configure
--prefix=/usr/local/proftpd \
> --enable-shadow --enable-autoshadow \
> --with -modules=mod_ratio:mod_readme:mod_wrap
#请注意,那个prefix表示我预计要安装proftpd的目录;
#至于--enable-shadow与--enable-autoshadow则是预计要以
#系统的/etc/shadow做为我的FTP登入时的密码验证档案!
#此外,还加入许多的支援模组,会让我们的Proftpd变的更活泼!
[root@test proftpd-1.3.3]# make && make install
#经过这个步骤之后,你的proftpd就会安装在/usr/local/proftpd之内,
#其中,设定档在/usr/local/proftpd/ etc/proftpd.conf !
#至于说明档(man pages)则在/usr/local/proftpd/man当中!
3.设定一些查询的相关功能!
[root@test proftpd-1.3.3]# vi /etc/man.config
#加入底下这一行,这样才能以man来查询指令的用法!
MANPATH /usr/local/proftpd/man
4.设置xinetd 来启动proftpd
事实上,目前大部分的FTP daemon 多是以super daemon 来启动的!所以这里我们也直接以xinetd
来设定proftpd 吧!毕竟多了一层管理,会更安全的啊!^_^!设定的方法也真是很简单~只要编辑xinetd 底下的proftpd
以及proftpd.conf 档案里面的一些内容即可!
[root@test root]# vi /etc/xinetd.d/proftpd
service ftp
{
disable =
no
flags = REUSE
socket_type = stream
wait = no
user = root
server
= /usr/local/proftpd/sbin/proftpd
server_args = -c
/usr/local/proftpd/etc/proftpd.conf
log_on_success += DURATION
USERID
log_on_failure +=
USERID
}
#上面的重点在于两行粗体字的地方!尤其是server =..那一行!
#由于我们是使用Tarball安装的,自然就以我们的档案放置目录为主,
#如果您使用RPM安装,这里就不太相同??
#另外,那个server_args后面接的则是设定档的档名咯!
[root@test root]# vi /usr/local/proftpd/etc/proftpd.conf
#找到底下这个设定值:
ServerType standalone
Group nogroup
#因为我们的系统预设并没有nogroup这个群组,所以必须要将他改成
#系统里面有的群组才行呐!而伺服器启动的方式有super daemon与
# stand alone ,所以:
ServerType inetd
Group nobody
[root@test root]# /etc/rc.d/init.d/xinetd restart
[root@test root]# netstat -tlnp
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 8483/xinetd
#呵呵!21这个埠口出现了!理论上没有问题,不过还是需要分析一下
# /var/log/messages这个档案的内容才行喔!
proftpd配置:
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single
server
# and a single anonymous login. It assumes that you have a
user/group
# "nobody" and "ftp" for normal operation and anon.
ServerName
"ProFTPD Default Installation"
ServerType
standalone
DefaultServer
on
UseReverseDNS
off
IdentLookups
off
AuthPAM
off
RequireValidShell
off
UserPassword username1 password1
UserPassword username2 password2
#其中password1可以用apache2自带的htpasswd -n username1 自动生成
# Port 21 is the standard FTP port.
Port
21
# Umask 022 is a good standard umask to prevent new dirs and
files
# from being group and world writable.
Umask
022
# To prevent DoS attacks, set the maximum number of child
processes
# to 30. If you need to allow more than 30 concurrent
connections
# at once, simply increase this value. Note that this ONLY
works
# in standalone mode, in inetd mode you should use an inetd
server
# that allows you to limit maximum number of processes per
service
# (such as xinetd).
MaxInstances
30
# Set the user and group under which the server will run.
User
nobody
Group
nobody
# To cause every FTP user to be "jailed" (chrooted) into their
home
# directory, uncomment this line.
DefaultRoot /your_project
# Normally, we want files to be overwriteable.
AllowOverwrite on
# Bar use of SITE CHMOD by default
DenyAll
AllowUser username1
AllowUser username1
DenyAll
# A basic anonymous configuration, no upload directories.
If you do not
# want anonymous users, simply delete this entire
section.
User
ftp
Group
ftp
# We want clients to be able to login with "anonymous" as
well as "ftp"
UserAlias
anonymous ftp
# Limit the maximum number of anonymous logins
MaxClients
10
# We want 'welcome.msg' displayed at login, and
'.message' displayed
# in each newly chdired directory.
DisplayLogin
welcome.msg
DisplayChdir
.message
# Limit WRITE everywhere in the anonymous chroot
DenyAll