RedHat Enterprise Linux 6.2_x86_64下编译安装vsftpd并配置Helix Server流媒体服务器

RedHat Enterprise Linux 6.2_x86_64下编译安装vsftpd并配置Helix Server流媒体服务器
作者:范春华 单位:中国空间技术研究院通信站 地址:北京市海淀区中关村南三街十八号通号信 联系电话:186********
部分方法来源于网络,本人通系统的整理而成此文,文中每个步聚均经过严格测试,个人认为已经最简了,有个小遗憾,未能解决Safari浏览器访问ftp资源中文乱码问题。
vsftpd(very secure FTP daemon)是一款在Linux发行版中最受推崇的FTP服务器程序,特点是小巧轻快,安全易用。但是使用rmp包安装的vsftpd在Windows的资源管理器和FileZilla上访问时产生乱码,使用cmds_allowed控制权限可以解决乱码的问题,但是采用命令登录ftp服务器时许多命令会报550 OOPS错误,本文通过重新编译,完美解决了上述问题。
Helix Server(也就是REAL服务器)的开源版本,RM媒体流服务器,支持RTSP协议,支持RM,MP3等格式,配合内容管理系统,可以搭建一个视频点播系统。
安装环境
系统版本:Red Hat Enterprise Linux Server release 6.2
内核Linux version 2.6.32-220.el6.x86_64
系统安装:基本安装,无任何定制
安装前的准备:
1.需要软件
rhel-server-6.2-x86_64-dvd.iso
vsftpd-2.3.5.tar.gz
tcpd.h
rarlinux-x64-4.1.1.tar.gz
helix-server-retail-11.01-rhel4-setup.bin
ISP-Hosting.lic
安装过程遇到*.so等依赖关系的提示,可以到https://www.360docs.net/doc/5117033024.html,/linux/RPM/index.html搜索CentOS 6.2 for x86_64对应的rpm包,获得rpm包名称后再在安装光盘中安装该软件包。
2.解决ssh登录中文乱码
[root@rmserver /]# vi /etc/sysconfig/i18n
将LANG="zh_CN.UTF-8" 改成 LANG="zh_CN.GB2312"
3.添加vsftpd的服务和虚拟宿主用户
[root@rmserver /]# useradd vsftpd -s /sbin/nologin
vsftpd服务的宿主用户
[root@rmserver /]# useradd -d /movie ftpuser -s /sbin/nologin
vsftpd虚拟宿主用户
[root@rmserver /]# chmod 755 /movie
*不允许相关用户登录,给予ftp目录相应的权限。
一、安装vsftpd
下载vsftpd的最新版,目录最新版是vsftpd-2.3.5.tar.gz
[root@rmserver ~]# cd /movie
[root@rmserver movie]# wget https://www.360docs.net/doc/5117033024.html,/distfiles/vsftpd-2.3.5.tar.gz
[root@rmserver movie]# tar zxvf vsftpd-2.3.5.tar.gz
[root@rmserver movie]# cd vsftpd-2.3.5
修改features.c和opts.c可以觖决资源管理器和FileZilla访问ftp服务器乱码问题。
[root@rmserver vsftpd-2.3.5]# vi features.c
去掉:vsf_cmdio_write_raw(p_sess, " UTF8\r\n");
[root@rmserver vsftpd-2.3.5]# vi opts.c
把opts.c文件的handle_opts函数修改成如下:
void
handle_opts(struct vsf_session* p_sess)
{
str_upper(&p_sess->ftp_arg_str);
//if (str_equal_text(&p_sess->ftp_arg_str, "UTF8 ON"))
//{
// vsf_cmdio_write(p_sess, FTP_OPTSOK, "Always in UTF8 mode.");
//}
//else
//{
vsf_cmdio_write(p_sess, FTP_BADOPTS, "Option not understood.");
//}
}
替换vsf

_findlibs.sh文件中的/lib为/lib64,使支持x86_64位系统。
[root@rmserver vsftpd-2.3.5]# sed -i 's/lib\//lib64\//g' vsf_findlibs.sh
编译需要安装gcc,进入光盘Packages文件夹,安装下列软件包。
[root@rmserver Packages]# rpm -ivh gcc-4.4.6-3.el6.x86_64.rpm cloog-ppl-0.15.7-1.2.el6.x86_64.rpm cpp-4.4.6-3.el6.x86_64.rpm glibc-devel-2.12-1.47.el6.x86_64.rpm ppl-0.10.2-11.el6.x86_64.rpm mpfr-2.4.1-6.el6.x86_64.rpm glibc-headers-2.12-1.47.el6.x86_64.rpm kernel-headers-2.6.32-220.el6.x86_64.rpm
启用pam认证,选择基本安装的系统还需要安装pam-devel,
[root@rmserver Packages]# rpm -ivh pam-devel-1.1.1-10.el6.x86_64.rpm
------------以下为配置vsftpd启用tcp_wrappers,如果不需要,可以省略------------
[root@rmserver vsftpd-2.3.5]# vi builddefs.h
修改#undef VSF_BUILD_TCPWRAPPERS为#define VSF_BUILD_TCPWRAPPERS,设置启用TCPWRAPPERS
[root@rmserver vsftpd-2.3.5]# wget https://www.360docs.net/doc/5117033024.html,/ghudson/dev/nognome/third/tcp_wrappers/tcpd.h
[root@rmserver vsftpd-2.3.5]# vi tcpwrap.c
将#include 改为#include "tcpd.h"。
编译启用TCPWRAPPERS需要安装tcp_wrappers,tcp_wrappers-devel,libtool-ltdl和libtool-ltdl-devel
[root@rmserver Packages]# rpm -ivh tcp_wrappers-devel-7.6-57.el6.x86_64.rpm
------------以上为配置vsftpd启用tcp_wrappers,如果不需要,可以省略------------
------------------------------------
编译提示usr/bin/ld: cannot find -l*
[root@rmserver Packages]# rpm -ivh libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm libtool-ltdl-devel-2.2.6-15.5.el6.x86_64.rpm
------------------------------------
[root@rmserver vsftpd-2.3.5]# make
不直接执行make install,采用手动安装文件到指定的目录。
[root@rmserver vsftpd-2.3.5]# install -m 755 vsftpd /usr/sbin/vsftpd
[root@rmserver vsftpd-2.3.5]# install -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8
[root@rmserver vsftpd-2.3.5]# install -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5
[root@rmserver vsftpd-2.3.5]# install -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd
[root@rmserver vsftpd-2.3.5]# which vsftpd
/usr/sbin/vsftpd
[root@rmserver vsftpd-2.3.5]# ldd vsftpd
如果有libpam.so.0 => /....说明加载pam成功。
[root@rmserver vsftpd-2.3.5]# mkdir /etc/vsftpd/
[root@rmserver vsftpd-2.3.5]# cp vsftpd.conf /etc/vsftpd
复制配置文件至/etc/vsftpd目录,并按附件1修改。
[root@rmserver vsftpd-2.3.5]# vi /etc/xinetd.d/vsftpd
在此修改vsftpd启动方式,修改disable = no(xinetd)为disable = yes(standalone)。
[root@rmserver vsftpd-2.3.5]# touch /etc/init.d/vsftpd
[root@rmserver vsftpd-2.3.5]# vi /etc/init.d/vsftpd
这个是vsftpd服务启动脚本,按附件2编写。
[root@rmserver vsftpd-2.3.5]# chmod 755 /etc/init.d/vsftpd
二、配置vsftpd
1.vsftpd配置文件vsftpd.conf的设置
[root@rmserver /]# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.back,备份。
[root@rmserver /]# vi /etc/vsftpd/vsftpd.conf
修改vsftpd.conf,按如下修改


anonymous_enable=YES
#设定不允许匿名访问,开启匿名访问需要建立/var/ftp目录。
local_enable=YES
#设定本地用户可以访问。注意:主要是为虚拟宿主用户,如果该项目设定为NO那么所有虚拟用户将无法访问。
write_enable=YES
#设定可以进行写操作。
local_umask=022
#设定上传后文件的权限掩码。
anon_upload_enable=NO
#禁止匿名用户上传。
anon_mkdir_write_enable=NO
#禁止匿名用户建立目录。
dirmessage_enable=YES
#设定开启目录标语功能。
xferlog_enable=YES
#设定开启日志记录功能。
connect_from_port_20=YES
#设定端口20进行数据连接。
chown_uploads=NO
#设定禁止上传文件更改宿主。
xferlog_file=/var/log/vsftpd.log
#设定Vsftpd的服务日志保存路径。注意,该文件默认不存在。必须要手动touch出来,并且由于这里更改了Vsftpd的服务宿主用户为手动建立的Vsftpd。必须注意给与该用户对日志的写入权限,否则服务将启动失败。
xferlog_std_format=YES
#设定日志使用标准的记录格式。
nopriv_user=vsftpd
#设定支撑Vsftpd服务的宿主用户为手动建立的Vsftpd用户。注意,一旦做出更改宿主用户后,必须注意一起与该服务相关的读写文件的读写赋权问题。比如日志文件就必须给与该用户写入权限等。
async_abor_enable=YES
ascii_upload_enable=YES
#设定支持异步传输功能。
ascii_download_enable=YES
#设定支持ASCII模式的上传和下载功能。
ftpd_banner=Welcome to My FTP service.
#设定Vsftpd的登陆标语。
chroot_local_user=YES
#禁止本地用户登出自己的FTP主目录。
listen=YES
#允许侦听
pam_service_name=vsftpd
#设定PAM服务下Vsftpd的验证配置文件名。因此,PAM验证将参考/etc/pam.d/下的vsftpd文件配置。
tcp_wrappers=YES
#设置tcp_wrappers安全
#以下这些是关于Vsftpd虚拟用户支持的重要配置项目。默认Vsftpd.conf中不包含这些设定项目,需要自己手动添加配置。
guest_enable=YES
#设定启用虚拟用户功能。
guest_username=ftpuser
#指定虚拟用户的宿主用户。
local_root=/movie
#指定用户目录到/movie
anon_root=/movie
#指定匿名用户目录到/movie
virtual_use_local_privs=YES
#设定虚拟用户的权限符合他们的宿主用户。
user_config_dir=/etc/vsftpd/vconf
#设定虚拟用户个人Vsftp的配置文件存放路径。也就是说,这个被指定的目录里,将存放每个Vsftp虚拟用户个性的配置文件,一个需要注意的地方就是这些配置文件名必须和虚拟用户名相同
2.建立Vsftpd的日志文件,并更改宿主为Vsftpd的服务宿主用户:
[root@rmserver /]# touch /var/log/vsftpd.log
[root@rmserver /]# chown vsftpd.vsftpd /var/log/vsftpd.log
3.建立虚拟用户配置文件存放路径:
[root@rmserver /]# mkdir /etc/vsftpd/vconf/
4.制作虚拟用户数据库文件
4.1先建立虚

拟用户名单文件:
[root@rmserver /]# touch /etc/vsftpd/virtusers
建立了一个虚拟用户名单文件,这个文件就是来记录vsftpd虚拟用户的用户名和口令的数据文件,我这里给它命名为virtusers。为了避免文件的混乱,我把这个名单文件就放置在/etc/vsftpd/下。
4.2编辑虚拟用户名单文件:
[root@rmserver /]# vi /etc/vsftpd/virtusers
admin
8899
upload
5678
Movie
123456
编辑这个虚拟用户名单文件,在其中加入用户的用户名和口令信息。格式很简单:“一行用户名,一行口令”。
4.3生成虚拟用户数据文件:
[root@rmserver /]# db_load -T -t hash -f /etc/vsftpd/virtusers /etc/vsftpd/virtusers.db
5.设定PAM验证文件,并指定虚拟用户数据库文件进行读取
[root@rmserver vsftpd-2.3.5]# touch /etc/pam.d/vsftpd
[root@rmserver vsftpd-2.3.5]# vi /etc/pam.d/vsftpd
按如下修改:
#%PAM-1.0
auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/virtusers
account sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/virtusers
6、虚拟用户的配置
6.1 upload能下载、上传但不能删除,vi /etc/vsftpd/vconf/upload
local_root=/movie/upload
cmds_allowed=ABOR,FEAT,REST,CWD,LIST,MDTM,MKD,NLST,PASS,PASV,PORT,PWD,QUIT,RMD,SIZE,STOR,TYPE,USER,ACCT,APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST
6.2 admin对ftp进行管理
默认的vsftpd.conf文件就可以了,不要做任何修改。
6.3 movie 只能下载,vi /etc/vsftpd/vconf/movie。
local_root=/movie
write_enable=NO
7.将/movie/upload给予相应的权限。
[root@rmserver vsftpd-2.3.5]# mkdir /movie/upload
[root@rmserver vsftpd-2.3.5]# chown ftpuser /movie/upload
8.设置vsftpd服务自动启动
[root@rmserver vsftpd-2.3.5]# chkconfig --add vsftpd
[root@rmserver vsftpd-2.3.5]# chkconfig vsftpd on
9、启动vsftpd
[root@rmserver vsftpd-2.3.5]# service vsftpd start
10.设置防火墙和Selinux:
[root@rmserver vsftpd-2.3.5]# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
[root@rmserver vsftpd-2.3.5]# service iptables save
[root@rmserver vsftpd-2.3.5]# vi /etc/sysconfig/iptables-config
查找IPTABLES_MODULES=""并改成IPTABLES_MODULES="nf_conntrack_ftp"
也可运行 system-config-firewall-tui 自定义防火墙,选择FTP为信任的服务。
[root@rmserver vsftpd-2.3.5]# service iptables restart
临时关闭selinux方法
[root@rmserver vsftpd-2.3.5]# setenforce 0
永久关闭selinux方法
[root@rmserver vsftpd-2.3.5]# vi /etc/sysconfig/selinux
查找SELINUX=enforcing,修改为SELINUX=disabled,重启计算机。
OK,现在可以通过浏览器或客户端访问ftp://admin:8899@159.226.209.5,并上传影片了。
三、Helix Server安装
1.下载软件
root@rmserver movie]# wget https://www.360docs.net/doc/5117033024.html,/lgz/14367.rar
root@rmserver movie]# wget https://www.360docs.net/doc/5117033024.html,/rar_CN/rarlinux-x64-4.1.1.tar.gz
root@rmserver movie]# tar zxvf rarlinux-x64-4.1.1.tar.gz


root@rmserver movie]# cd rar
[root@rmserver rar]# make
[root@rmserver rar]# make install
[root@rmserver rar]# cd /movie
root@rmserver movie]# unrar x -o- -y 14367.rar
2.安装Helix Server
root@rmserver movie]# cd 14367
[root@rmserver 14367]# cd https://www.360docs.net/doc/5117033024.html,
[root@rmserver https://www.360docs.net/doc/5117033024.html,]# tar zxvf setup.tar.gz
[root@rmserver https://www.360docs.net/doc/5117033024.html,]# chmod +x helix-server-retail-11.01-rhel4-setup.bin
[root@rmserver https://www.360docs.net/doc/5117033024.html,]# ./helix-server-retail-11.01-rhel4-setup.bin
-bash: ./helix-server-retail-11.01-rhel4-setup.bin: /lib/ld-linux.so.2: bad ELF interpreter: 没有那个文件或目录
这是因为缺少ld-linux.so.2库文件,打开网址https://www.360docs.net/doc/5117033024.html,/linux/RPM/index.html,搜索ld-linux.so.2对应的RPM包,找到CentOS 6.2 for x86_64对应的RPM包为glibc-2.12-1.47.el6.i686.rpm。放入rhel-server-6.2-x86_64安装光盘。
[root@rmserver helix]# mount /dev/cdrom /mnt/cdrom
[root@rmserver helix]# cd /mnt/cdrom/Packages
提示错误依赖关系:
warning: glibc-2.12-1.47.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
error: Failed dependencies:
libfreebl3.so is needed by glibc-2.12-1.47.el6.i686
libfreebl3.so(NSSRAWHASH_3.12.3) is needed by glibc-2.12-1.47.el6.i686
重新到网站https://www.360docs.net/doc/5117033024.html,/linux/RPM/index.html搜索相应RPM包为
nss-softokn-freebl-3.12.9-11.el6.i686.rpm。
[root@rmserver Packages]# rpm -ivh glibc-2.12-1.47.el6.i686.rpm nss-softokn-freebl-3.12.9-11.el6.i686.rpm
warning: glibc-2.12-1.47.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:nss-softokn-freebl ########################################### [ 50%]
2:glibc ########################################### [100%]
安装helix-server依赖软件包成功。
[root@rmserver Packages]# cd /movie/14367/https://www.360docs.net/doc/5117033024.html,/
[root@rmserver https://www.360docs.net/doc/5117033024.html,]# ./helix-server-retail-11.01-rhel4-setup.bin
./helix-server-retail-11.01-rhel4-setup.bin: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
查找libstdc++.so.6对应RPM安装包为:libstdc++-4.4.6-3.el6.i686.rpm,libgcc-4.4.6-3.el6.i686.rpm,安装成功后就可以开始安装helix了。
正式安装helix-server
[root@rmserver https://www.360docs.net/doc/5117033024.html,]# ./helix-server-retail-11.01-rhel4-setup.bin
一路回车,输入管理的用户名和密码(admin:123456),安装目录为/helix,管理端口为1111,其余按缺省配置。
License Key File: []: /movie/14367/https://www.360docs.net/doc/5117033024.html,/crack/ISP-Hosting.lic
Directory: [/movie/14367/https://www.360docs.net/doc/5117033024.html,]: /helix
Username []: admin
Passwork []: 123456
RTSP Port: 554
HTTP Port: 80
MMS Port: 1755
Admin Port: 1111
Destination: /helix
3.启动服务:
[root@rmserver https://www.360docs.net/doc/5117033024.html,]# cd /helix
[root@rmserver helix]# ./Bin/rmserver rmserver.cfg &[ 启动服务器进程并让它在后台执行, ]
4.修改防火墙规则,vi /etc/sysconfig/iptables

,添加如下规则,并重启iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 554 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1755 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1111 -j ACCEPT
重启iptables:service iptables restart
5.修改helix-server配置
这时你的流媒体服务器已经正常运行了,可以在远程进行维护.我是在另一台WINDOWS机上进行维护的.打开IE(或其他浏览器),输入 http://159.226.209.5:1111/admin/index.html,输入安装时设置的管理用户名和密码(admin:123456)就可以进行管理了,进入Server Setup,修改Mount Points?Base Path为/movie。这样通过ftp上传的电影就可以用Helix流媒体服务器提供流媒体服务了。
也可以编辑/helix/rmserver.cfg文件进行修改。
[root@rmserver helix]# vi /helix/rmserver.cfg
查找BasePath="/helix/Content",将其修修为BasePath="/movie"
6.添加helix为服务并自动启动。
[root@rmserver helix]# touch /etc/init.d/helix
[root@rmserver helix]# vi /etc/init.d/helix
按附件3编辑helix服务启动脚本。
[root@rmserver helix]# chmod 755 /etc/init.d/helix
[root@rmserver helix]# chkconfig --add helix
[root@rmserver helix]# chkconfig helix on
[root@rmserver helix]# service helix restart
全部完成!
-----------------------------------------------------------------------------------------------------------
附件
------------------------------------------------------------------------------------------------------------
附件1:vsftpd配置文件 /etc/vsftpd/vsftpd.conf;附件2:vsftpd服务启动脚本 /etc/init.d/vsftpd;附件3:helix服务启动脚本 vi /etc/init.d/helix 。
附件1:vsftpd配置文件
[root@rmserver vsftpd-2.3.5]# vi /etc/vsftpd/vsftpd.conf
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write inable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
anon_upload_enable=NO
#
# Uncomment this if you want the anony

mous FTP user to be able to create
# new directories.
anon_mkdir_write_enable=NO
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
chown_uploads=NO
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
nopriv_user=vsftpd
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
ascii_upload_enable=YES
ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to My FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# When "listen" directive i

s enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES

pam_service_name=vsftpd
#userlist_enable=YES
tcp_wrappers=YES
guest_enable=YES
guest_username=ftpuser
local_root=/movie
anon_root=/movie
virtual_use_local_privs=YES
user_config_dir=/etc/vsftpd/vconf

附件2:vsftpd服务启动脚本
[root@rmserver vsftpd-2.3.5]# vi /etc/init.d/vsftpd

#!/bin/bash
#
# vsftpd This shell script. takes care of starting and stopping
# standalone vsftpd.
#
# chkconfig: - 60 50
# description: Vsftpd is a ftp daemon, which is the program \
# that answers incoming ftp service requests.
# processname: vsftpd
# config: /etc/vsftpd/vsftpd.conf
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x /usr/sbin/vsftpd ] || exit 0
RETVAL=0
prog="vsftpd"
start() {
# Start daemons.
if [ -d /etc/vsftpd ] ; then
for i in `ls /etc/vsftpd/*.conf`; do
site=`basename $i .conf`
echo -n $"Starting $prog for $site: "
/usr/sbin/vsftpd $i &
RETVAL=$?
[ $RETVAL -eq 0 ] && {
touch /var/lock/subsys/$prog
success $"$prog $site"
}
echo
done
else
RETVAL=1
fi
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Shutting down $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/$prog ]; then
stop
start
RETVAL=$?
fi
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVA
附件3:helix服务启动脚本
[root@rmserver init.d]# vi /etc/init.d/helix

#!/bin/bash
#
# chkconfig: 345 92 92
# description: RealMedia Streaming Server
#
# processname: rmserver
# config: /helix/rmserver.cfg
# pidfile: /helix/Logs/rmserver.pid

progname=helix
lockfile=/var/lock/subsys/rmserver
prog=/helix/Bin/rmserver
conffile=/helix/rm

server.cfg
[ -f $conffile ] || exit $?

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

RETVAL=0

start() {
echo -n $"Starting $progname: "
daemon $prog $conffile --hbi 159.226.209.5 &
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $lockfile
return $RETVAL
}

stop() {
echo -n $"Stopping $progname: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f $lockfile
return $RETVAL
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $prog
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f $lockfile ]; then
stop
start
fi
;;
reload)
action $"Reloading $progname:" killall -HUP $prog
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
exit 1
esac

exit $RETVA

--------------------------------------------------------------------------------

fans_sky

相关文档
最新文档