您的位置:首页 > 编程语言 > PHP开发

在ubuntu10.4服务器版本下安装vsftp

2014-02-09 23:13 459 查看
终于顺利的按成vsftp的安装文档完成了对vsftp的安装。写下安装的过程,希望给其他人带来帮助,特别感谢这篇文章的作者:http://www.2cto.com/os/201110/109225.html

1、首先,通过wget命令下载vsftp的源码(当然,可以通过apt-get install vsftpd安装,但是,总觉得不知对系统做了什么,所以通过下载源码来安装比较安心)命令如下:

sudo wget ftp://vsftpd.beasts.org/users/cevans/untar/vsftpd-2.0.5/* -r
(之后的* 保证全部都下载 一定要加-r参数,不然会没有下载全,仅仅下载了文件,目录没有下载。)


2、之后进入目录,使用more命令查看安装帮助文档INSTALL

#more INSTALL (空格向下,b向上)

3、根据安装文档的信息,首先要先编译,即make,键入

#make

在make的时候可能会出现类似如下信息的错误

sysdeputil.c:1129: error: storage class specified for parameter 's_utent'

sysdeputil.c:1134: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token

sysdeputil.c:1173: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token

sysdeputil.c:1189: error: old-style parameter declarations in prototyped function definition

sysdeputil.c:162: error: parameter name omitted

sysdeputil.c:162: error: parameter name omitted

sysdeputil.c:162: error: parameter name omitted

sysdeputil.c:1189: error: expected '{' at end of input

make: *** [sysdeputil.o] Error 1

根据上网查询到的信息,是sysdeputil.c 文件出错,需要打补丁 补丁的文件是attachment.bin。去网络上下载attachment.bin之后键入命令

#
patch sysdeputil.c attachment.bin


之后继续键入make即可完成编译

4、之后根据安装文档的提示,要添加一个nobody用户,键入命令

# useradd nobody



一般情况下会有这个提示useradd: user nobody exists

5、继续,vsftpd needs the (empty) directory /usr/share/empty in the default

所以#mkdir /usr/share/empty/

6、根据For anonymous FTP, you will need the user "ftp" to exist, and have a valid home directory (which is NOT owned or writable by the user "ftp").The following commands could be used to set up the user "ftp" if you do not

have one:的提示,我们需要建立一个路径给匿名用户,键入命令


#mkdir /var/ftp/



# useradd -d /var/ftp ftp(限定匿名用户的目录在/var/ftp下)



# chown root.root /var/ftp



# chown root.root /var/ftp



7、安装make install

根据提示

Running "make install" will try to copy the binary, man pages, etc. tosomewhere sensible.Or you might want to copy these things by hand, e.g.:

cp vsftpd /usr/local/sbin/vsftpd

cp vsftpd.conf.5 /usr/local/man/man5

cp vsftpd.8 /usr/local/man/man8


如果在安装的时候提示系统中没有man5和man8,则自己建立一个,即可。
同时根据提示"make install" doesn't copy the sample config file. It is recommended you do this:

#cp vsftpd.conf /etc

之后Edit /etc/vsftpd.conf, and add this line at the bottom:

listen=YES


8、测试运行

#/usr/local/sbin/vsftpd &

安装完成

最后# 注:若要开机自动启动vsFTPd,请在/etc/rc.d/rc.local中加入:/usr/local/sbin/vsftpd &
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: