How to install Red5 Media Server on CentOS VPS and Dedicated Servers

1. Install Java using yum. (The -y flag provides a ‘yes’ answer to all prompts.)
yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel

2. Install the Apache ant binary. I downloaded the most recent release one directly from Apache’s archives. The version installed using yum (and default repositories) will not compile Red5.
cd /usr/src
tar xjvf apache-ant-1.8.1-bin.tar.bz2
mv apache-ant-1.8.1 /usr/local/ant

3. Set important Java environment variables.
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/

4. You should also add them to bashrc so they’re available the next time you log in.
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/' >> /etc/bashrc

5. Install subversion with yum. If you did a base install of CentOS, subversion will not be preinstalled.
yum -y install subversion

6. Check out the Red5 source.
cd /usr/src
svn co red5

7. Build Red5 with ant.
mv red5 /usr/local/
cd /usr/local/red5
ant prepare
ant dist

8. Start Red5.
cp -r dist/conf .

9. Create a startup script (optional):
vi /etc/init.d/red5
Then enter this text into the file.
# Startup script for Red5 flash streaming server on RedHat/CentOS (cPanel)
# chkconfig: 2345 95 55
# description:  Red5 Flash Streaming Server
# processname: red5


# Source function library
. /etc/rc.d/init.d/functions

[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5


case "$1" in
echo -n $"Starting $PROG: "
$DAEMON >/dev/null 2>/dev/null &
if [ $RETVAL -eq 0 ]; then
echo $! > $PIDFILE
touch /var/lock/subsys/$PROG

[ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
echo -n $"Shutting down $PROG: "
killproc -p $PIDFILE
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
$0 stop
$0 start
status $PROG -p $PIDFILE
echo $"Usage: $0 {start|stop|restart|status}"

exit $RETVAL

10. Set permissions on the script.
chmod a+x /etc/init.d/red5
chkconfig red5 on

11. Add necessary ports to the iptables file.
vi /etc/sysconfig/iptables
Then add the following lines:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5080 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1935 -j ACCEPT
You may also want to add exceptions for 8443, 8088, 9035, 1936, and 9999 if necessary for your application,
service iptables restart
You may want to restart the server, and the Red5 test page can be accessed at http://localhost(or servername):5080/

  • 37 Users Found This Useful
Was this answer helpful?

Related Articles

How to unzip .tar.bz2 file

To unzip bzip file use:tar -xvjf filename.tar.bz2 First make sure you have installed bzip...

Buy web hosting with Mercado Pago

Web hosting with MercadoPago: fast and reliable Due to advances in technology, especially on the...

OpenVPN install on CentOS VPS or Dedicated Server

* Login to your VPS shell.......... Open the terminal console.... * Download the packets#wget...

Buy VPS with Skrill

Buy VPS with Skrill Setup a Website with VPS A website is one of the most important marketing...

Buy web hosting with Payza

Web Hosting and Payza Payment System When an organization or a company wants to make their...