Thursday, February 27, 2014

How to install Red5 media server 1.0 on Centos redhat

Best part about red5 is it is open source, Red5 Media Server 1.0 delivers a powerful video streaming and multi-user solution it is Based on Java and some of most powerful open source frameworks, To install Red5 media server 1.0 in centOS follow the steps below.



  • SSH your server as root user
Step 1 Install Java in your server.
  • yum install java-1.7.0-openjdk

Step 2 Now time to Install ANT as it is prerequisite for red5 media server follow the steps below.
  • cd /usr/local/src
  • wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.2-bin.tar.gz
  • tar zxvf apache-ant-1.8.2-bin.tar.gz
  • mv apache-ant-1.8.2 /usr/local/ant
Step 3 Now we have to export paths of ANT and Java
  • export ANT_HOME=/usr/local/ant
  • export JAVA_HOME=/usr/lib/jvm/java
  • export PATH=$PATH:/usr/local/ant/bin
  • export CLASSPATH=.:$JAVA_HOME/lib/classes.zip
  • 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
Step4 Finally we will install red5 media server
  • wget http://www.red5.org/downloads/red5/1_0_1/red5-1.0.1.tar.gz
  • tar zxvf red5-1.0.1.tar.gz 
  • mv /usr/local/src/red5-server-1.0  /usr/local/red5
  • mv * /usr/local/red5
Step 5 We have installed red5 media server now we need to create service to start stop and restart red5 media server, Copy the content below and paste it to the file red5 below
  • vi /etc/init.d/red5
 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
  • chmod +x /etc/init.d/red5
  • /etc/init.d/red5 start
  • Make sure port 1935 and 5080 are open
  • now is IP:5080 to access your red5 media server

Red5 is installed if you face any issue at any step do let me know i am always here to help you out.

2 comments:

Ankit said...

Simple and error free tutorial....

Unknown said...

Thanx Ankit :-)

Post a Comment

Do Write about the Blog and Welcome to the world where open source is every thing :-)