fixyourserver.com

A lot of stuff and things…

How To: Install Red5 Media Server

Here we go!
Check for subversion, if not installed

yum install subversion

Make sure you have java. If you don’t, you should, else go get it.

Next, install Apache ANT

cd /opt/
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz
tar -zxf apache-ant-1.7.1-bin.tar.gz
rm apache-ant-1.7.1-bin.tar.gz
mv apache-ant-1.7.1/ ant
export ANT_HOME=/opt/ant
ln -s /opt/ant/bin/ant /usr/bin/ant
ant -v

good good…

Now for red5, while still in /opt/

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

Depending on your server setup:

cat /usr/sbin/starttomcat

Grab the JAVA_HOME from here, as long as java’s working, and do:

export JAVA_HOME=/usr/local/jdk

Your path may vary.
now ant

export ANT_HOME=/opt/ant/

Now you should still be in /opt but anyways

cd /opt/red5/
/opt/ant/bin/ant prepare
/opt/ant/bin/ant dist

This will more than likely take a few minutes
Make sure ports 5080 and 1935 are opened up.

Now lets make a startup script!

touch /etc/init.d/red5
chmod 755 /etc/init.d/red5

Cool it’s made. Now add the following to it:

#!/bin/sh
# red5
# chkconfig: 2345 95 55
# description: red5  server startup script

# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
else
echo "Could not find functions file, your system may be broken"
exit 1
fi

# Source networking configuration.
if [ -f "/etc/sysconfig/network" ] ; then
. /etc/sysconfig/network
fi

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting red5: "
cd /opt/red5/dist/; sh red5.sh 2 >/dev/null &
echo_success
echo
touch /var/lock/subsys/red5
;;
stop)
# Stop daemons.
echo -n "Shutting down red5: "
cd /opt/red5/dist/; sh red5-shutdown.sh 2 >/dev/null
echo_success
echo
rm -f /var/lock/subsys/red5
;;
*)
echo "Usage: red5 {start|stop}"
exit 1
esac

exit 0

Now do:

service red5 start

and visit you.r.IP.ADDRESS:5080 and you should see this baby rollin!

-Radar

Next Post

Previous Post

Leave a Reply

© 2017 fixyourserver.com

Theme by Anders Norén