How To Install RED5 Server on Centos 5.3

by enbeeone3 on 28/08/09 at 2:20 pm

In this how to i will describe how to install RED5 server on Centos 5.3. This how to can be used to install RED5 server on Centos 4 and Fedora 8 – 11 as well. RED5 is open source flash server written in java supports streaming audio/video, recording client streams, shared objects, live stream publishing etc.

1) Download and Install Java

[wikipop]RED5[/wikipop] server depends on Java. [wikipop]CentOS [/wikipop]5.3 comes with OpenJDK 1.6 and install it using yum.

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

2) Download and Install Ant ([wikipop]Apache[/wikipop] Project)

Ant will need to compile RED5 server code. Ant comes in binary form, so just download and install it in /usr/local directory.

cd /usr/src

wget http://opensource.become.com/apache/ant/binaries/apache-ant-1.7.1-bin.tar.gz

tar zxvf apache-ant-1.7.1-bin.tar.gz

mv apache-ant-1.7.1/ /usr/local/ant

3) Export Variables for 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

Also export these variables in /etc/bashrc to become available for every user login or for any terminal opens.

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

Here the latest version available for RED5 is 0.7 on site but download from google code using svn as the tarball of 0.7 on site is missing some of the files.

cd /usr/src

svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5

mv red5 /usr/local/

cd /usr/local/red5

ant prepare

ant dist

you will see a ton of lines, but you should get at last

BUILD SUCCESSFUL

that’s mean its install and now copy the conf directory from dist/ and test the red5 installation.

cp -r dist/conf .

./red5.sh

If it shows Installer service created in the last then everything is fine here, press ctrl+c and move to next step to create init script.

5) Init Script

Now we will create init script for red5 to start, stop and restart easily.

vi /etc/init.d/red5

copy and paste following code in it.

#!/bin/sh

# For RedHat and cousins:

# chkconfig: 2345 85 85

# description: Red5 flash streaming server

# processname: 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: ”

$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

Now start the service

/etc/init.d/red5 start

check status

/etc/init.d/red5 status

red5 (pid  XXXXX) is running…

again you can do stop, restart.

6) Test

Now test the RED5 installation by opening following URL in browser

http://yourip:5080/

you will see red5 page like this

red5_11

and demos can be find here.

http://yourip:5080/demos/

red5_21

You can use simple port tester tool that determines which ports the Flash Player is able to connect through to the Red5 server. Put your server address or IP in HOST when using port tester. You should get SUCCESS on RTMP or port 1935. If not please check your firewall.

http://yourip:5080/demos/port_tester.html

red5_3

If you any question please use comments.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

3 Responses to “How To Install RED5 Server on Centos 5.3”

  1. tweetrl.com

    Dec 30th, 2009

    How To Install RED5 Server on Centos 5.3 …

    In this how to i will describe how to install RED5 server on Centos 5.3. This how to can be used to install RED5 server on Centos 4 and Fedora 8 – 11 as well. RED5 is open source flash server written in java supports streaming audio/video, recording cl…

  2. Jane

    Jun 21st, 2010

    I dun see the player under the text 'Start Here' after installation! Can you tell me why?

    • enbeeone3

      Jun 22nd, 2010

      Please Recheck every procedure correctly . This works perfectly with Centos 5.3

Leave a Reply


You must be logged in to post a comment.