最新消息:时间抓起来说是金子,抓不住就是流水。

CentOS 6.3安装red5

LINUX技术 老子黑牵翻 3019浏览 0评论
下载:
下载地址在http://www.red5.org/downloads/red5/
寻找自己需要的版本下载
 
安装
本人测试用的是red5-1.0.0-RC1.tar.gz这个版本
解压:tar zxvf red5-1.0.0-RC1.tar.gz
mv red5-1.0.0 /usr/local/red5
useradd red5
chown -R red5.red5 /usr/local/red5
 
red5还需要安装jdk,在这里我就不细说如何安装jdk了,我的jdk是安装在/usr/local/jdk1.6
 
配置启动脚本
 
vi /etc/init.d/red5
 
#!/bin/bash
#
# red5  Starts Red5.
# chkconfig: 345 88 12
# description: Red5 flash streaming server
#
# processname: java (unfortunately)
# pidfile: /tmp/red5.pid
 
# Source function library.
. /etc/rc.d/init.d/functions
 
RED5_HOME=/usr/local/red5
RUNTIME_USER=red5
JAVACMD=/usr/local/jdk1.6/bin/java
DESCR="Red5 flash streaming server"
PID_FILE=/var/run/red5.pid
PID=`ps ax |grep java|grep red5|sed "s/\([0-9]\) .*/\1/"`
RETVAL=0
 
# JAVA options
# You can set JAVA_OPTS to add additional options if you want
# Set up logging options
LOGGING_OPTS="-Dlogback.ContextSelector=org.red5.logging.LoggingContextSelector -Dcatalina.useNaming=true"
# Set up security options
SECURITY_OPTS="-Djava.security.debug=failure"
export JAVA_OPTS="$LOGGING_OPTS $SECURITY_OPTS $JAVA_OPTS"
 
if [ -z “$RED5_MAINCLASS” ]; then
  export RED5_MAINCLASS=org.red5.server.Bootstrap
fi
 
# Jython options
JYTHON="-Dpython.home=lib"
 
export RED5_CLASSPATH="${RED5_HOME}/boot.jar:${RED5_HOME}/conf:${CLASSPATH}"
 
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
 
# Read config file if it is present.
if [ -r /etc/red5.conf ]
then
. /etc/red5.conf
fi
 
 
start() {
echo -n $"Starting $DESCR: "
# daemon $JAVACMD $OPTIONS > /dev/null 2>&1 &
cd $RED5_HOME
su -p -s /bin/sh $RUNTIME_USER -c "\"$JAVACMD\" \"$JYTHON\" -Dred5.root=\"${RED5_HOME}\" $JAVA_OPTS -cp \"${RED5_CLASSPATH}\" \"$RED5_MAINCLASS\" $RED5_OPTS" > /dev/null 2>&1 &
RETVAL=$?
[ $RETVAL = 0 ] && touch /var/lock/subsys/red5 && echo $!>$PID_FILE && echo_success
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $DESCR: "
#killproc $PID_FILE
[[ $PID != “” ]] && success && kill $PID || failure
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/red5 $PID_FILE
}
 
 
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 3
start
;;
*)
echo $"Usage: $DESCR {start|stop|restart"
exit 1
esac
 
exit $RETVAL
 
保存,给与权限
chown red5.red5 /etc/init.d/red5
chmod +x /etc/init.d/red5
 
验证使用
首先是启动red5
service red5 start
在你本机的浏览器上输入http://192.168.1.104:5080  (我的red5是安装在192.168.1.104这台centos服务器上的)
点击 Install a ready-made application
会显示出一个列表,在这个列表,我们选择oflaDemo安装
等待(这段时间可能会比较长)
然后我们可以进入http://192.168.1.104:5080/demos/ofla_demo.html这个页面
把rtmp://localhost/oflaDemo改成rtmp://192.168.1.104/oflaDemo然后再点connect,链接成功,完成

转载请注明:LINUX服务器运维架构技术分享 » CentOS 6.3安装red5

头像
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址