Building a Red5 Virtual Appliance on Jeos
Posted on 23. Aug, 2009 by joshhrob in Streaming, Virtualization
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

Enter the following to install openssh
sudo apt-get install openssh-server

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

Enter the following command to download red5 source code from googlecode
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5-read-only

Enter the following commands to set your environment variables
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export ANT_HOME=/usr/share/ant/

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

After the code is compiled create a permanent directory for the red5 installation
sudo mkdir /usr/share/red5

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

Enter the following to copy all of the compiled files to the permenant installation directory
sudo cp -R * /usr/share/red5

Make the red5.sh startup script executable
sudo chmod 777 /usr/share/red5/red5.sh

Test red5 installation by entering the following
/usr/share/red5/red5.sh &

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

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

Enter the following to activate startup script
sudo update-rc.d red5 defaults

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.
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