Knowledgebase: VisiChat Installation
How to install Red5 on CentOS
Posted by VisiChat Hosting, Last modified by VisiChat Hosting on 17 December 2014 02:06 PM

To install Red5 on your CentOS system, you need to download it from the red5.org website. In order to run Red5, you must have Java runtime files.

Installing JDK

To install JDK using yum package manager, you need to login using your root password into your server via SSH and run the following command:

[$]#yum install java-1.6.0-openjdk

To install JDK using apt package manager, you need to login to your server with root privileges via SSH and run a slightly different set of commands:

[$]#apt-get update
[$]#apt-get install openjdk-7-jdk 

You can test Java installation has been successful by running:

[$]#java -version

Which should print the version of the Java runtime that's currently installed.

For servers running an Windows Operating System, you should get the JDK package installer directly from Oracle at:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

You should pick the JDK version that fits your OS, but we recommend to stick with the Standard Edition 32-bit as both Visichat and the server it relies on are 32-bit apps. After you download the package, double click on the executable and install the software in a convenient location, like:

C:\Java

The default location installer sets is also fine. You do not need to change any other installer settings and can click through to the installation.

Only proceed with the Red5 server installation if you've a working copy of JDK 1.6 or later installed on your system.

Log in into your web server using the root username via SSH and run the following commands.

cd /opt/
mv red5 red5-backup
wget http://red5.org/downloads/red5/1_0/red5-1.0.0-RC2.tar.gz 
tar -zxf red5-1.0.0-RC2.tar.gz 
mv red5-1.0.0 red5

Now that you have downloaded Red5, you need to add an auto startup script. To do so, we will edit /etc/init.d/red5 file and add the auto startup script using the following line.

nano /etc/init.d/red5

Add the following contents into the file.

#! /bin/sh
# For RedHat and cousins:
# processname: red5
cd /opt/red5
PROG=red5-highperf
RED5_HOME=/opt/red5
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid
# Source function library
. /etc/rc.d/init.d/functions
[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5
RETVAL=0
case "$1" in
       start)
           echo -n $"Starting $PROG: "
           $DAEMON >/dev/null 2>/dev/null &
           RETVAL=$?
           if [ $RETVAL -eq 0 ]; then
               echo $! > $PIDFILE
               touch /var/lock/subsys/$PROG
           fi
           [ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
           echo
           ;;
       stop)
           echo -n $"Shutting down $PROG: "
           killproc -p $PIDFILE
           RETVAL=$?
           echo
           [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
           ;;
       restart)
           $0 stop
           $0 start
           ;;
       status)
           status $PROG -p $PIDFILE
           RETVAL=$?
           ;;
       *)
           echo $"Usage: $0 {start|stop|restart|status}"
           RETVAL=1
esac
exit $RETVAL

Hit Ctrl+w to write out the contents in the nano and then press Ctrl+x to exit. Now you need to add execute permission to this file using the following command.

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

Now run the following codes to make sure Red5 starts whenever you reboot your system.

cd / etc/rc2.d 
ln /etc/init.d/red5 S89red5 -s
cd ../rc3.d
ln /etc/init.d/red5 S89red5 -s
cd ../rc5.d
ln /etc/init.d/red5 S89red5 -s

To restart your Red5, you can use the following command.

/etc/init.d/red5 restart
(12 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).