服务器 频道

Liunx流媒体代理服务器架设攻略(上)

    【IT168 专稿】笔者以前曾经介绍过:手把手教您配置Liunx流媒体服务器(点击阅读),下面介绍一下如何构建Liunx流媒体代理服务器。

一、 Liunx流媒体代理服务器的作用

    目前有三种主流的流媒体系统: 分别是RealNetworks公司的RealMedia、Microsoft的Windows Media和Apple公司的QuickTime。本文使用的Liunx流媒体代理服务器是:RealNetworks Helix Proxy,版本v11.0.1.1884.Linux,Helix Proxy 是配置在企业网络内部,作为网关来接收网络内外RealPlayer 请求服务器的工具。也可以被服务提供商用作管理本网络之外的内容请求。Helix Proxy是安装在网络ISP的网关中实时收集和处理客户端流媒体请求的工具。Helix Proxy 通过缩减请求中的冗余性来节省带宽,提高网络效率。Linux网络环境流媒体代理服务器的工作原理我们看一下图1。


                       图1 Liunx流媒体代理服务器工作原理

    局域网中的客户机不能直接互联网中的流媒体服务器,此时可以通过流媒体代理服务器来突破限制。
二、Linux流媒体代理服务器的安装准备

    1 软件下载

    使用Helix Proxy之前,首先要在http://www.realnetworks.com/ 页面中填写自己使用的操作系统、用户姓名、电子邮件地址、公司名称、网址等相应信息,接着你就可以下载到Helix Proxy的天试用版。此时需要提醒大家注意的是,这里的电子邮件地址一定要填写可以正常使用的,否则将无法收取到RealNetworks公司发送的试用授权文件。注册结束后,RealNetworks公司会向你的电子邮件发送一个授权码(License Key),让你在服务器使用Helix,授权码的格式是Zip包请把它解压后保存,在安装软件时要使用。接着就可以选择下载Helix Proxy了。最新版本号是:v11.0.1.1884.Linux。

    2 系统要求

    首先配置一个基于Apache的LAMP服务器,另外在软件方面它要求内核(Kenerl)至少在2.4以上。硬件方面中央处理器:奔腾III667 以上 ,内存 128 兆 ,硬盘空间 600兆、OSS/Linux兼容声卡、16兆显示内存 。
三、安装软件

    1、 以根权限登陆Linux X-Windows,建立一个Helix的目录将授权码拷贝到目录中。
#mkdir Helix
#cp helix-proxy-retail-11.01-rhel4-setup.bin /Helix
    2、改变下载的文件名称和组属性和组使它成为可执行文件。
#chmod +x helix-proxy-retail-11.01-rhel4-setup.bin
    3、安装详细步骤
# ./helix-proxy-retail-11.01-rhel4-setup.bin Extracting files for Helix installation........................ Welcome to the Helix Proxy 11.0 (11.0.1.1884) Setup for UNIX Setup will help you get Helix Proxy running on your computer. Press [Enter] to continue...
#这里按回车继续# If a Helix Proxy license key file has been sent to you, please enter its directory path below. If you have not received a Helix Proxy license key file, then this server WILL NOT OPERATE until a license key file is placed in the server's License directory. Please obtain a free Basic Helix Proxy license or purchase a commercial license from our website at http://www.real.com/. If you need further assistance, please visit our on-line support area at http://service.real.com/. License Key File: []:这是要许可证,等安装完再将许可证文件放入 Installation and use of Helix Server requires acceptance of the following terms and conditions: Press [Enter] to display the license text... 按回车继续显示协议文本,此处略过…… Choose "Accept" to accept the terms of this #此处回车默认即可 Enter the complete path to the directory where you want Helix Proxy to be installed. You must specify the full pathname of the directory and have write privileges to the chosen directory. Directory: [/root/helix]: # 更改安装路径 Please enter a username and password that you will use to access the web-based Helix Server Administrator and monitor. Username []: # 设置远程管理用户名 Username []:Password []: # 设置密码 Confirm Password []: #重新确认密码 Please enter a port on which Helix Proxy will listen for RTSP connections. These connections have URLs that begin with "rtsp://" Port [554]: #此处回车默认即可 Please enter a port on which Helix Proxy will listen for HTTP connections. These connections have URLs that begin with "http://" Port [8080]: #此处回车默认即可 Please enter a port on which Helix Proxy will listen for MMS connections. These connections have URLs that begin with "mms://" Port [1755]: #此处回车默认即可 Helix Proxy will listen for Administrator requests on the port shown. This port has been initialized to a random value for security. Please verify now that this pre-assigned port will not interfere with ports already in use on your system; you can change it if necessary. Port [18298]: #更改远程管理访问的端口,系统默认的 You have selected the following Helix Server configuration: Admin User/Password: traveller2/**** Encoder User/Password: traveller2/**** Monitor Password: **** RTSP Port: 554 HTTP Port: 8080 MMS Port: 1755 Admin Port: 11111 Destination: /usr/helixserver Enter [F]inish to begin copying files, or [P]revious to go back to the previous prompts: [F]: #如果以上设置你没意见,此处回车默认即可,否则按P重新设置 Copying Helix Server files.... Helix Server installation is complete. If at any time you should require technical assistance, please visit our on-line support area at http://service.real.com/. Cleaning up installation files... Done. # 安装完成
    图2 是Helix Proxy安装成功界面。


图2 Helix Proxy安装成功界面
四、Helix Proxy的启动监控和和停止

    1 启动服务器

    首先进入安装目录。使用命令在后台启动:
./Bin/rmproxy rmproxy.cfg &
    启动过程可以看到服务器版本和系统平台的信息,如下:
#./Bin/rmproxy rmproxy.cfg Helix Proxy (c) 1995-2005 RealNetworks, Inc. All rights reserved. Version: Helix Proxy 11.0 (11.0.1.1884) (Build 74277/5688) Platform: linux-rhel4-i686 Using Config File: rmproxy.cfg Linux kernel version 2.6.18-8.el5xen detected [glibc 2.5/NPTL 2.5] Starting PID 2550 TID 3086846192/2550, procnum 0 (controller) Creating Server Space... Server has allocated 256 megabytes of memory Starting TID 3084909440/2552, procnum 1 (timer) Calibrating timers... Interval timer enabled (10ms resolution). Starting TID 3082812288/2553, procnum 2 (core) Starting Helix Proxy 11.0 Core... 1 CPU Detected... Testing File Descriptors... Setting per-process descriptor capacity to 672(1003), 21... Testing Mutex...(538.00 ops/usec) Testing AtomicOps...(14.09 ops/usec) I: Loading Plugins from /root/dvdrip-0.98.6/Plugins... I: slicensepln.so 0xfceec0 RealNetworks Licensing Plugin I: plusplin.so 0xf77070 RealNetworks PlusURL File Format Plugin I: encfs.so 0x8a2e10 RealNetworks Encoder Administration File System Plugin ……
    2 监控服务器的进程

    可以使用ps命令监控流媒体服务器的运行进程

# ps -ef|grep rmproxy root 2234 1977 0 17:57 pts/1 00:00:00 ./Bin/rmproxy rmproxy.cfg root 2235 2234 22 17:57 ? 00:00:10 ./Bin/rmproxy rmproxy.cfg root 2236 2234 0 17:57 ? 00:00:00 ./Bin/rmproxy rmproxy.cfg root 2284 2251 0 17:57 pts/2 00:00:00 grep rmproxy
    说明:说明其中PID为2234是主进程,其他两个2235和2236是子进程。

    3 监控端口

    可以使用命令监控流媒体代理服务器端口运行情况:
# netstat -ntulp | grep rmproxy
    结果如图3 。


图3 监控流媒体代理服务器端口运行情况

    说明:19007 即远程服务器管理端口。

    4停止流媒体代理服务器工作

    由于Helix服务器没有提供服务器停止命令,所以只能通过使用传统的“Kill”来“杀掉服务器的进程”,使用命令:
#kill ‘cat ./Logs/rmproxy.pid’
    5系统启动时自动加载Helix服务器

    如果想在启动Linux服务器时自动加载Helix服务。方法如下:开始菜单-首选项-更多首选项-会话-启动程序-增加-启动命令, 输入:./Bin/rmproxy rmproxy.cfg确定。 五、流媒体客户端软件的设置

    1. windows 客户端软件设置

    (1) realplayer

    realplayer媒体浏览器代理服务器设置方法:打开“信号流代理服务器设置”对话框。选择 PNA、RTSP 或 HTTP 代理服务器。针对每个可用的代理服务器,输入该服务器的适当域名或 IP 地址,并输入 RealOne Player 用于与代理服务器进行通信的端口。如图4 。


图4信号流代理服务器设置

    说明:此设置只会影响您的媒体浏览器,而不会影响信号流内容。

    (2) Windows Media Player的设置

    Windows Media Player用于连接到 Internet 的代理服务器的名称或 IP 地址。端口。键入您希望用于连接到 Internet 的代理服务器的端口号,或使用所选协议的默认端口。代理服务器对所选协议使用下面的默认端口: HTTP:端口 80。 MMS:端口 1755。 RTSP:端口 554。 由于代理服务器可作为您的 Intranet 与 Internet 之间的安全屏障,因此您可能需要系统管理员的额外许可才能通过代理服务器访问网页。如果不使用代理服务器,则可以更加快捷地访问本地地址。对于以下列字符开头的地址不使用代理服务器。键入无需通过代理服务器即可访问的 Web 地址。如果要连接到 Intranet 上的计算机,请确保在此框中键入其地址。例如,对于名为 Joe1 的计算机,键入“Joe1”。可以使用通配符匹配域名、主机名或地址,例如,www.*.com、128.*、240.*、*mygroup.*、*x* 等等。

图-5 是RTSP设置界面。


图-5 RTSP设置界面

    (3) quicktime 7 的设置

    作为一款多媒体播放程序,QuickTime Player支持的文档格式并非只有视频这么简单,还包括音频、静止图像、图形和虚拟现实 (VR) 影片。QuickTime 支持 Internet 上新闻、体育、教育、影片预告片和其他娱乐节目所使用的大多数最流行的格式。quicktime 7的代理服务器在偏好设置中如图-6所示。


图-6 uicktime 7的代理服务器在偏好设置中


    2. Linux 流媒体客户端的设置

    推荐使用RealPlayer10GOLD for Linux,最新版本是: RealPlayer10GOLD.rpm ,图-7是RealPlayer10GOLD for Linux代理服务器设置界面。



图-7 RealPlayer10GOLD for Linux代理服务器设置界面


    总结:到此为止Linux下流媒体代理服务器helix proxy安装介绍完了,下篇文章笔者将介绍通过浏览器管理helix proxy的方法,敬请关注。
0
相关文章