CentOS安裝Red5

一、 RED5

  1) Download and Install Java

  yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel

 2) Download and Install Ant

  wget http://apache.etoak.com/ant/binaries/apache-ant-1.8.0-bin.tar.gz

  tar –zxvf apache-ant-1.8.0-bin.tar.gz

  mkdir /usr/local/ant

  mv apache-ant-1.8.0-bin /usr/local/ant 

 3) Export Variables for Ant and Java

  echo 'export ANT_HOME=/usr/local/ant' >> /etc/bashrc

  echo 'export JAVA_HOME=/usr/lib/jvm/java' >> /etc/bashrc

  echo 'export PATH=$PATH:/usr/local/ant/bin' >> /etc/bashrc

  echo 'export CLASSPATH=.:$JAVA_HOME/lib/classes.zip' >> /etc/bashrc

4) Download and Install RED5 Server

  wget http://www.red5.org/downloads/0_8/red5-0.8.0.tar.gz

  tar –zxvf red5-0.8.0

  mkdir /usr/local/red5

  mv red5-0.8.0 /usr/local/red5

  ./red5.sh

  如果最后一行顯示:Installer service created,則安裝成功。

5) Init Script

  vi /etc/init.d/red5→編輯腳本


#!/bin/bash
# For RedHat and cousins:
# chkconfig: 2345 85 85
# description: Red5 flash streaming server
# processname: red5
# Created By: Sohail Riaz (sohaileo@gmail.com)

PROG=red5
RED5_HOME=/usr/local/red5
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid

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

[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5

RETVAL=0

case "$1" in
start)
echo -n $"Starting $PROG: "
cd $RED5_HOME
$DAEMON >/dev/null 2>/dev/null &
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo $! > $PIDFILE
touch /var/lock/subsys/$PROG
fi
[ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
echo
;;
stop)
echo -n $"Shutting down $PROG: "
killproc -p $PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
;;
restart)
$0 stop
$0 start
;;
status)
status $PROG -p $PIDFILE
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
esac

exit $RETVAL

  chkconfig –add red5

  chmod 755 /etc/init.d/red5
  /etc/init.d/red5 start

6) Test

  http://ip:5080/


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 mokiss 的頭像
    mokiss

    筆記○心情

    mokiss 發表在 痞客邦 留言(0) 人氣()