[求助]Proftpd源码安装问题

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
cyxhome
帖子: 5
注册时间: 2005-11-19 18:58

[求助]Proftpd源码安装问题

#1

帖子 cyxhome » 2005-11-19 19:45

由于本机用的是utf-8,windows用户登录FTP,中文文件名全是乱码,从网上搜到可以通过打补丁的方法设置本机和远程字符集,但要重新用源码安装。remove proftpd,删除/etc/proftpd.conf后,按以下步骤安装:

1. 先下载proftpd-1.2.10.tar.bz2
http://www.proftpd.org/

2.下载proftpd-1.2.10-iconv.patch.gz
http://home.h01.itscom.net/para/softwar ... dex-e.html

3.放在同一个资料夹下
tar jxvf proftpd-1.2.10.tar.bz2
解开资料
gzip -cd proftpd-1.2.10-iconv.patch.gz |patch -p0
patch动作

4.在configure里加入
"--with-modules=mod_codeconv:mod_df"
make
make install

5.在proftpd.conf配置文件里加入
CharsetLocal UTF-8
CharsetRemote CP936

就可以在windows看到简体中文了

proftpd默认安装目录为/usr/local/sbin/,配置文件在/usr/local/etc/proftpd.conf

这时要执行/usr/local/sbin/proftpd手动开启FTP服务,为了开机就自动运行,我按以下方法创建proftpd脚本:

在proftpd的源代码目录
cp proftpd-1.2.10/contrib/dist/rpm/proftpd.init.d /etc/init.d/proftpd
修改proftpd文件,一般要修改proftpd的实际路径,由于是默认安装,所以不用改。

执行 chmod 755 /etc/init.d/proftpd

本以为万事大吉了,却发现新的问题:

执行 /etc/init.d/proftpd restart 出错信息如下:
/etc/init.d/proftpd: line 19: /etc/rc.d/init.d/functions: 没有那个文件或目录


附上/etc/init.d/proftpd的内容:
#!/bin/sh
#
# Startup script for ProFTPD
#
# chkconfig: 345 85 15
# description: ProFTPD is an enhanced FTP server with \
# a focus toward simplicity, security, and ease of configuration. \
# It features a very Apache-like configuration syntax, \
# and a highly customizable server infrastructure, \
# including support for multiple 'virtual' FTP servers, \
# anonymous FTP, and permission-based directory visibility.
# processname: proftpd
# config: /etc/proftpd.conf
#
# By: Osman Elliyasa <osman@Cable.EU.org>
# $Id: proftpd.init.d,v 1.7 2002/12/07 21:50:27 jwm Exp $

# Source function library.
. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/proftpd ]; then
. /etc/sysconfig/proftpd
fi

PATH="$PATH:/usr/local/sbin"

# See how we were called.
case "$1" in
start)
echo -n "Starting proftpd: "
daemon proftpd $OPTIONS
echo
touch /var/lock/subsys/proftpd
;;
stop)
echo -n "Shutting down proftpd: "
killproc proftpd
echo
rm -f /var/lock/subsys/proftpd
;;
status)
status proftpd
;;
restart)
$0 stop
$0 start
;;
reread)
echo -n "Re-reading proftpd config: "
killproc proftpd -HUP
echo
;;
suspend)
hash ftpshut >/dev/null 2>&1
if [ $? = 0 ]; then
if [ $# -gt 1 ]; then
shift
echo -n "Suspending with '$*' "
ftpshut $*
else
echo -n "Suspending NOW "
ftpshut now "Maintanance in progress"
fi
else
echo -n "No way to suspend "
fi
echo
;;
resume)
if [ -f /etc/shutmsg ]; then
echo -n "Allowing sessions again "
rm -f /etc/shutmsg
else
echo -n "Was not suspended "
fi
echo
;;
*)
echo -n "Usage: $0 {start|stop|restart|status|reread|resume"
hash ftpshut
if [ $? = 1 ]; then
echo '}'
else
echo '|suspend}'
echo 'suspend accepts additional arguments which are passed to ftpshut(8)'
fi
exit 1
esac

if [ $# -gt 1 ]; then
shift
$0 $*
fi

exit 0

附上/usr/local/etc/proftpd.conf的内容:
# 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 "My_FTP_Server"
ServerType standalone
DefaultServer on

CharsetLocal UTF-8
CharsetRemote CP936

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

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot ~

# Normally, we want files to be overwriteable.
AllowOverwrite on
AllowRetrieveRestart on
AllowStoreRestart on

# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit>

# A basic anonymous configuration, no upload directories. If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
<Anonymous ~ftp>
User ftp
Group ftp
RequireValidShell off

# 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
DisplayFirstChdir .message

# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE>
DenyAll
</Limit>
</Anonymous>
回复