Building a Red5 Virtual Appliance on Jeos

Posted on 23. Aug, 2009 by in Streaming, Virtualization

Print This Post Print This Post

VN:F [1.6.3_896]
Rating: 9.0/10 (1 vote cast)

Interested in getting your VCP 410 Certification? Check out thisVCP 410 Test Prep


This document outlines the creation of a Red5 Virtual Appliance on Jeos using VMWare Workstation 6.5.

Please Refer to this article Building a Virtual Appliance with Jeos for details on Virtual Appliance Creation and Jeos installation, and deployment.

This virtual appliance can be downloaded here.

Enter the following commands to install prerequisite packages:

sudo apt-get install subversion
sudo apt-get install java-package
sudo apt-get install sun-java6-jdk
sudo apt-get install ant

Jeos-2009-08-21-14-30-35

Enter the following to install openssh

sudo apt-get install openssh-server

red5server-2009-08-22-20-16-46

Enter the following to create a temporary red5 directory and navigate to it

mkdir red5
cd red5

Jeos-2009-08-21-14-36-01

Enter the following command to download red5 source code from googlecode

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

Jeos-2009-08-21-14-38-04

Enter the following commands to set your environment variables

export JAVA_HOME=/usr/lib/jvm/java-6-sun
export ANT_HOME=/usr/share/ant/

Jeos-2009-08-21-14-42-00

Change directories to the red5-read-only directory and enter the ant command to compile the code

cd red5-read-only
/usr/share/ant/bin/ant

Jeos-2009-08-21-14-42-52

After the code is compiled create a permanent directory for the red5 installation

sudo mkdir /usr/share/red5

Jeos-2009-08-21-14-45-24

The code was compiled to the dist directory. Change directories to dist

cd dist

Jeos-2009-08-21-14-46-07

Enter the following to copy all of the compiled files to the permenant installation directory

sudo cp -R * /usr/share/red5

Jeos-2009-08-21-14-47-10

Make the red5.sh startup script executable

sudo chmod 777 /usr/share/red5/red5.sh

Jeos-2009-08-21-14-47-49

Test red5 installation by entering the following

/usr/share/red5/red5.sh &

Jeos-2009-08-21-14-48-07

Open your browser and goto http://IPADDRESS:5080

Next we will install a startup script so that the red5 server will start automatically when the system boots. Create a file named red5 in the /etc/init.d directory

sudo vi /etc/init.d/red5

Jeos-2009-08-21-16-47-15

Enter the following code

#! /bin/sh
#
# red5 red5 initscript
#
# Author: Simon Eisenmann .
#

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC=”Red5 flash streaming server”
NAME=red5
RED5_HOME=/usr/share/red5
DAEMON=$RED5_HOME/$NAME.sh
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

# Read config file if it is present.
if [ -r /etc/default/$NAME ]
then
. /etc/default/$NAME
fi

#
# Function that starts the daemon/service.
#
d_start() {
start-stop-daemon –start –pidfile $PIDFILE \
–chdir $RED5_HOME –background –make-pidfile \
–exec $DAEMON
}

#
# Function that stops the daemon/service.
#
d_stop() {
start-stop-daemon –stop –quiet –pidfile $PIDFILE \
–name java
rm -f $PIDFILE
}

case “$1” in
start)
echo -n “Starting $DESC: $NAME”
d_start
echo “.”
;;
stop)
echo -n “Stopping $DESC: $NAME”
d_stop
echo “.”
;;
restart|force-reload)
echo -n “Restarting $DESC: $NAME”
d_stop
sleep 1
d_start
echo “.”
;;
*)
echo “Usage: $SCRIPTNAME {start|stop|restart|force-reload}” >&2
exit 1
;;
esac

exit 0

Enter the following to make file executable

sudo chmod 777 /etc/init.d/red5

Jeos-2009-08-21-16-48-03

Enter the following to activate startup script

sudo update-rc.d red5 defaults

Jeos-2009-08-21-16-49-26

At this point all that is left is cleanup and packaging. Please refer to:
Please Refer to this article Building a Virtual Appliance with Jeos for details.

For installation see of this virtual appliance see Installing Red5 Virtual Appliance

If you have questions or problems with this build please leave a comment below.

VN:F [1.6.3_896]
Rating: 9.0/10 (1 vote cast)

Tags: , ,

Print This Post Print This Post

One Comment

Haldun

16. Oct, 2009

Hi, thanks for the great guide to build RED5!
I wonder you can help me to run my Video sharing script together with RED5. Course the script is asking for the path to store the encoded Flash files. My path to Red5 is /usr/local/share/xxxx/red5/. OflaDemo is also working …

I would like to hear about port security what we can do to secure serve Videos in the Internet .

Thanks

Leave a reply