Installing Red5 on cPanel / WHM (CentOS) servers
Install Red5 on cPanel

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).

INSTALL JAVA

yum -y install java-1.6.0-openjdk  java-1.6.0-openjdk-devel

INSTALL ANT

cd /root/tmp
wget http://mirrors.kahuki.com/apache/ant/bin...in.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

INSTALL RED5

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

paste the script below than save and close by pressing ESC than typing :wq

Code:

#!/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 and execute:

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

RED5 ADMIN
http://YOUR_SERVER_IP:5080/installer/ (install admin)
http://YOUR_SERVER_IP:5080/admin/register.html (add user/pass)

http://YOUR_SERVER_IP:5080/admin/

TROUBLESHOOTING

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

tomcat-dbcp.jar – only needed if the next error occurs:
javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]
*if the above error occurs, place the tomcat-dbcp.jar in [red5 root]/lib and restart red5

mysql-connector-java-5.1.12-bin.jar missing
if you are unable to connect to backend services, it means that the MySQL driver is missing, download it and place it in your /lib folder

commons-dbcp-1.4.jar missing
if you are unable to start your Red5 application (or it doesn’t even show up in admin), download commons-dbcp-1.4.jar and place it in your /lib folder

Red5 Admin not found Red5 0.9
After installing Red5 0.9 and trying to access SERVER_IP:5080/admin/ you will (may) encounter the following error:

HTTP Status 404 – /admin
type Status report
message /admin
description The requested resource (/admin) is not available.
Apache Tomcat/6.0.26

no problem, the admin panel was moved here: SERVER_IP:5080/demos/adminPanel.html

When logging in, use the server IP for “Server Address” and the user “admin” with the password “admin”.

If that does not work, you must register an admin user, just follow the instructions below:[/b]
*assuming that your Red5 installation path is /usr/local/red5 if it is different (ex. /opt/red5 or /opt/red5/dist/) just change those values in the following commands

Get the plugins:

cd /root/tmp
mkdir /usr/local/red5/plugins
wget http://red5.googlecode.com/files/AdminPlugin-1.0.zip
unzip -d /usr/local/red5/plugins AdminPlugin-1.0.zip

Get the Red5 admin register page:

mkdir /usr/local/red5/webapps/admin
wget http://red5.googlecode.com/files/admin.jsp
mv admin.jsp /usr/local/red5/webapps/admin

*restart Red5 (/etc/init.d/red5 restart)

Access Register Admin page: YOUR_IP:5080/admin/admin.jsp and register your admin user and password.

Finally go back to SERVER_IP:5080/demos/adminPanel.html and log in using the user and password you just registered (and your server IP).