Installing Red5 on cPanel / WHM (CentOS) servers
Install Red5 on cPanel
How to install Red5 on cPanel (WHM) server?
This short description will work on most Linux CentOS servers (most cPanel/WHM, VPS or dedicated). If you have a shared hosting account, please contact your server administrator to install Red5.
*to run the commands below, you will need SSH access and you might need a client to connect (PuTTy or similar).
We’ll describe the installation using two different (almost similar methods). If one of the steps fails on your server, scroll down and try the alternative.
INSTALL JAVA
yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel
Alternatively, Install a RPM (WHM)
java-1.6.0-openjdk
java-1.6.0-openjdk-devel
INSTALL ANT
cd /root/tmp wget http://mirrors.kahuki.com/apache/ant/binaries/apache-ant-1.8.0-bin.tar.bz2 tar jxvf apache-ant-1.8.0-bin.tar.bz2 mv apache-ant-1.8.0 /usr/local/ant
EXPORT VARIABLES FOR ANT AND JAVA
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/classes.zip
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/classes.zip' >> /etc/bashrc
INSTALL SVN
yum install perl-URI
yum install subversion
If you get an error when installing SVN, usually: Error: Missing Dependency: perl(URI) >= 1.17 is needed by …
wget http://yum.trixbox.org/centos/5/RPMS/perl-URI-1.35-3.noarch.rpm rpm -i perl-URI-1.35-3.noarch.rpm
*this will install perl URI and you can go with yum install subversion
Alternatively, Install a RPM (WHM)
INSTALL RED5
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5
*or ignore the above and consider the more stable:
svn co http://red5.googlecode.com/svn/java/server/tags/0_8_0/ red5 mv red5 /usr/local/ cd /usr/local/red5
ant prepare ant dist cp -r dist/conf .
START RED5
./red5.sh
CREATE INIT FILE
vi /etc/init.d/red5
*create the file and paste the script below than save and close by pressing ESC than typing :wq
Insert Red5 init script
#!/bin/sh
# Startup script for Red5 flash streaming server on RedHat/CentOS (cPanel)
# chkconfig: 2345 95 55
# description: Red5 Flash Streaming Server
# processname: red5
PROG=red5
RED5_HOME=/usr/local/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: "
cd $RED5_HOME
$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
Make it executable
chmod a+x /etc/init.d/red5
*usage: /etc/init.d/red5 restart (or start, stop)
RED5
RED5 ADMIN
http://YOUR_SERVER_IP:5080/installer/ (and install admin)
http://YOUR_SERVER_IP:5080/admin/register.html (add user/pass)

Register admin username & password
http://YOUR_SERVER_IP:5080/admin/

Log in to Red5 admin
INSTALL JABBERCAM APPLICATION
cd /root/tmp wget http://www.chatroulette-clone.com/downloads/java/app/2.8/ChatrouletteApp.zip unzip ChatrouletteApp.zip mv ChatrouletteApp /usr/local/red5/webapps /etc/init.d/red5 restart
*some custom CRC versions may need the JabberCamApp (refer to your README.txt file)
http://YOUR_SERVER_IP:5080/admin/ and you should see ChatrouletteApp or JabberCamApp in the list
TROUBLESHOOT RED5
http://YOUR_SERVER_IP:5080/demos/port_tester.html
* when testing ports, use server IP not localhost
Make these ports accept connections: 1935, 1936, 5080, 8088
RESTART RED5
If you have the init script created (start, stop and restart):
/etc/init.d/red5 start /etc/init.d/red5 stop /etc/init.d/red5 restart
Without init script (go to red5 folder first):
cd /urs/local/red5 ./red5-shutdown.sh
Check if it is running:
ps aux | grep red5
* if you see it is running (you see a process: user ID ….), stop the process: kill ID
To stop all java processes (as root):
killall -q -u root java
RED5 LARGE LOG FILE
/usr/local/red5/log/red5.log is getting too big
Solution: add an appender to /usr/local/red5/conf/logback.xml (MaxHistory 11 days and MaxFileSize 100MB here. You may change it)
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/red5.log</File>
<Append>false</Append>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>log/red5.%d{yyyy-MM-dd}.log</FileNamePattern>
<MaxHistory>11</MaxHistory>
</rollingPolicy>
<Encoding>UTF-8</Encoding>
<BufferedIO>false</BufferedIO>
<ImmediateFlush>true</ImmediateFlush>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{ISO8601} [%thread] %-5level %logger{35} - %msg%n</Pattern>
</layout>
<triggeringPolicy>
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
</appender>
You can also separate Red5 logs using a Threshold Filter:
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>log/red5errors.log</File> <Append>false</Append> <filter> <level>WARN</level> </filter> ... </appender>
Installing Red5 on cPanel / WHM (CentOS) servers
Install Red5 on cPanel
How to install Red5 on cPanel (WHM) server?
Second, similar method
Preparing installation
yum install rpm-build redhat-rpm-config uname -am
*to make sure we have everything necessary to install the rpm
*if uname result is i686_64 than you have 64 bit system
*allow ports required by Red5: 5080, 1935, 1936, 8088 and 3690 for svn
Installing JAVA
Download JDK for Linux to your temp folder: http://java.sun.com/javase/downloads/index.jsp
cd /usr/src wget http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u20-linux-i586-rpm.bin?BundledLineItemUUID=rytIBe.lNB8AAAEofmwAhiZ7&OrderID=fKpIBe.lTGwAAAEocWwAhiZ7&ProductID=guBIBe.oc_wAAAEnaDJHqPYe&FileName=/jdk-6u20-linux-i586-rpm.bin mv jdk-.... jdk-6u20-linux-i586-rpm.bi
*download JDK (not JRE) >> Select Linux (or Linux x64) >> Java SE Development Kit 6u20 (jdk-6u20-linux-i586-rpm.bin)
Make the downloaded file executable and execute the command to start installation:
su chmod a+x jdk-6u20-linux-i586-rpm.bin ./jdk-6u20-linux-i586-rpm.bin
*su changes the user to super user (ex. root) to be able to install the rpm
*Press ENTER (–More–) and accept the terms
Check if latest Java version is used:
java –version
*make sure to change shortcuts if you had previous Java installations so they point to the latest one
Installing ANT
Download Ant from http://ant.apache.org/bindownload.cgi
wget http://ftp.wayne.edu/apache/ant/binaries/apache-ant-1.8.0-bin.tar.gz tar zxvf apache-ant-1.8.0-bin.tar.gz mv apache-ant-1.8.0 /usr/local/ant
*unzip and move to ant path: /usr/local/ant
ant -version
*if there is an error: “Error: JAVA_HOME is not defined correctly. We cannot execute /usr/local/jdk/bin/java”
export JAVA_HOME=/usr/java/latest/
Configuring environment variable:
export ANT_HOME=/usr/local/ant ln -s /usr/local/ant/bin/ant /usr/local/bin/ant
Installing SVN
yum install subversion
Installing Red5
Download Red5 from http://red5.googlecode.com/svn/java/server/tags/
svn co http://red5.googlecode.com/svn/java/server/tags/0_8_0/ red5
Build Red5:
cd /opt/red5 ant prepare ant dist
Start Red5:
./red5.sh &
*check if Red5 is running, access http://YOUR-IP:5080/
Finally:
Install admin: http://YOUR-IP:5080/installer/
Add user: http://your-server:5080/admin/register.html
NOTE: This is a short (informative) description, based on own experience and 3rd party descriptions. This summary might not be enough to start your Red5 installation or to install on non default configured servers. If you encounter problems or errors, please refer to our sub-forum: http://www.chatroulettemarket.com/forum/forum-7.html












Recent Comments