第四步:安装配置ftp服务器
本文根据网上流行的一篇文章整理改编而成,并修正了原文的一些小错误 。
由于为每一个需要使用ftp服务的用户建立系统帐户会影响系统的安全,所以我们使用数据库用户进行ftp用户验证 。
系统组成:
Proftpd1.2.7proftpd-mod-quotatab-1.2.4mysql3.23因为ports里没有proftpd-mod-quotatab-1.2.4模块,我们下载源代码安装 。
下载源代码包:(必须下载相同版本的源代码包)
到http://www.proftpd.org 或ftp://ftp.servus.at/ProFTPD/distrib/source/proftpd-1.2.7.tar.gz去下载proftpd-1.2.7.tar.gz 。
到http://www.castaglia.org/proftpd/ 去下载proftpd-mod-quotatab-1.2.4.tar.gz 。(1.2.5 版本的mod_quotatab是用在1.2.8rc1上的)
用ftp将它们上传到/home/ylf/app目录 。
然后解压缩源代码包:
# cd /home/ylf/app
# tar zxvf proftpd-1.2.7.tar.gz
# tar zxvf proftpd-mod-quotatab-1.2.4.tar.gz进入mod-quotatab目录
# cd mod_quotatab把mod_quotatab中的文件拷贝到proftpd 中的modules 目录中
# cp * ../proftpd-1.2.7/modules在开始运行configure之前,我们要先改动一个文件
进入 proftpd-1.2.7/contrib 目录
# cd /home/ylf/app/proftpd-1.2.7/contrib修改 mod_sql_mysql.c
# vi mod_sql_mysql.c找到#include
#include 然后编译安装:
# cd /home/ylf/app/proftpd-1.2.7
#./configure --prefix=/usr/local/proftpd --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql --with-includes=/usr/local/include/mysql --with-libraries=/usr/local/lib/mysql
# make
# make install进入到proftpd配置文件所在目录
# cd /usr/local/proftpd/etc备份原配置文件
# mv proftpd.conf proftpd.conf.bak然后编辑新的配置文件proftpd.conf
# vi proftpd.conf我的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 "ftpx.3322.org"
ServerType standalone
DefaultServer on
# 用户登陆时不显示ftp服务器版本信息
ServerIdent off
# 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
MaxLoginAttempts 3
TimeoutLogin 120
TimeoutIdle 600
TimeoutNoTransfer 900
TimeoutStalled 3600
MaxClients 100
# 设置每台主机最多并发连接数
MaxClientsPerHost 3
AllowOverwrite no
AllowStoreRestart on
UseReverseDNS off
# 设置如果shell为空时允许用户登录
RequireValidShell off
# 将用户限制在自己的主目录下
DefaultRoot ~ ftpusers
DefaultRoot ~ FTPGRP
# 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 FTPUSR
Group FTPGRP
# Normally, we want files to be overwriteable.
AllowOverwrite on
# A basic anonymous configuration, no upload directories.
# 匿名登录设置 。匿名用户目录为/ftp
User ftp
Group ftpusers
# 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.
推荐阅读
- 49 FreeBSD连载:进入X Window
- FreeBSD Find的介紹
- FreeBSD网站平台建设全过程 第五步
- FreeBSD Biabam 邮件附件
- FreeBSD网站平台建设全过程 第二步
- FreeBSD+Resin成功建立支持Jsp平台
- B 系统 FreeBSD 升级
- FreeBSD网站平台建设全过程 前言
- 1 FreeBSD 核心
- Domino系统从UNIX平台到windows平台的迁移及备份