Installing Red5 on Ubuntu 10.04 LTS

1. Add java partner to sources

sudo nano /etc/apt/sources.list

add this

deb http://archive.canonical.com lucid partner

2. Install java

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

3. Download and Install Red5

wget http://trac.red5.org/downloads/0_9/red5-0.9.1.tar.gz
tar xfz red5-0.9.1.tar.gz
mv red5-0.9.1 red5
sudo mv red5 /usr/local/

4. Create a Red5 user

sudo adduser –system –group –home /usr/local/red5 red5

5. Change the owner of /usr/local/red5

sudo chown -R red5.red5 /usr/local/red5

5. Create Red5 Deamon

sudo nano /etc/init.d/red5

paste this script

#! /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/local/red5
DAEMON=$RED5_HOME/$NAME.sh
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
RED5_USER=red5

# 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 -c $RED5_USER --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

6. Give execute permission

sudo chmod +x /etc/init.d/red5

7.  Add to services

sudo update-rc.d red5 defaults

8. Start the daemon

sudo /etc/init.d/red5 start

6. Check if Red5 is running ok.

netstat -ant

Check for: “tcp6 0 0 :::5080 :::* Listen”

Go to http://yoursite:5080 and you should see red5 landing page there.

2 thoughts on “Installing Red5 on Ubuntu 10.04 LTS

  1. sudo apt-get install sun-java6-jdk
    sudo apt-get install sun-java6-jre

    the above commands are not working

    instead try sudo apt-get install openjdk-6-jdk

Leave a comment