Red5 es un servidor Open Source para entregar contenido en streaming en Flash. Para ello utiliza el protocolo RTMP (Real Time Messaging Protocol) con lo cual se puede transmitir contenido en tiempo Real.
Instalamos el soporte Java y subversion:
# yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel subversion
Descargamos el servidor Apache-ANT:
# cd /usr/src
# wget -c http://www.apache.org/dist/ant/binaries/apache-ant-1.8.1-bin.tar.bz2
Es importante tomar en cuenta que las versiones pueden variar, así que si este archivo ya no se encuentra disponible date una pasada por http://www.apache.org/dist/ant/binaries/ y descarga la última versión.
# tar xvfj apache-ant-1.8.1-bin.tar.bz2
Movemos el directorio hacia su destino final:
# mv apache-ant-1.8.0 /usr/local/ant
Agregamos las variables de entorno (para pruebas) y creamos los enlaces simbólicos correspondientes:
# export ANT_HOME=/usr/local/ant
# ln -s /usr/local/ant/bin/ant /usr/local/bin/ant
Verificamos que el servidor Apache-ANT este funcionando:
Instalamos Red5 descargando la fuente desde subversion:
# cd /usr/src
# svn co http://red5.googlecode.com/svn/java/server/trunk red5
Construimos/compilamos Red5:
# cd red5
# ant prepare
# ant dist
Movemos Red5 al directorio final:
# cd ..
# mv red5 /opt/red5
Operando con Red5:
Iniciando el servicio por primera vez:
Verificamos que el servicio este arriba:
Si el servicio está arriba enhorabuena... ya esta funcionando, ahora necesitamos trabajar en el detalle fino y buenas prácticas.
Vamos a detener el servicio:
# cd /opt/red5/dist
# ./red5-shutdown.sh
Ahora vemos que el servicio no se encuentra activo:
Restauramos el servicio y le damos un vistazo a los logs:
# ./red5.sh > start.log &
Nos aseguramos de que el servicio esta arriba:
Volvemos a detener el servicio:
# cd /opt/red5/dist
# ./red5-shutdown.sh
Automatizamos el servicio:
Creamos el archivo red5 dentro del /etc/init.d con el siguiente 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=/opt/red5/dist
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
# above is 0 if you copy paste from this blog and this does not work just replace o above by #zero
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
Asignamos los permisos para hacerlo ejecutable (obvio verdad) y lo iniciamos.
Abrimos un navegador e ingresamos en http://ipdelservidor:5080
Para que se inicie al encender el servidor entramos en directorio #/etc/init.d/# y ejecutamos:
# chkconfig --add red5
# chkconfig --level 345 red5 on
Modo de uso
# service red5 (start|stop|restart)
Reinicia tu servidor y el servicio se debe ejecutar automáticamente al encenerlo.
Nota:
No se recomienda realizar la instalación desde yum porque genera un error el paquete. Evita hacer esto, deja la flojera e instalalo a mano:
Class org.apache.tools.ant.taskdefs.ConditionTask doesn't support the nested "antversion" element
Referencias utilizadas:
http://mightydreams.blogspot.com/2010/06/installing-red5-on-centos-55-64-bit.html
http://abdullahakay.blogspot.com/2010/07/red5-demo-error-trying-to-connect-to.html
http://www.chatroulette-clone.com/questions/faq/installing-red5-cpanel/
http://www.slideshare.net/gmoggia/red5-1685304
Red5 es un servidor Open Source para entregar contenido en streaming en Flash. Para ello utiliza el protocolo RTMP (Real Time Messaging Protocol) con lo cual se puede transmitir contenido en tiempo Real.
Instalamos el soporte Java y subversion:
# yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel subversion
Descargamos el servidor Apache-ANT:
# cd /usr/src
# wget -c http://www.apache.org/dist/ant/binaries/apache-ant-1.8.1-bin.tar.bz2
Es importante tomar en cuenta que las versiones pueden variar, así que si este archivo ya no se encuentra disponible date una pasada por http://www.apache.org/dist/ant/binaries/ y descarga la última versión.
# tar xvfj apache-ant-1.8.1-bin.tar.bz2
Movemos el directorio hacia su destino final:
# mv apache-ant-1.8.0 /usr/local/ant
Agregamos las variables de entorno (para pruebas) y creamos los enlaces simbólicos correspondientes:
# export ANT_HOME=/usr/local/ant
# ln -s /usr/local/ant/bin/ant /usr/local/bin/ant
Verificamos que el servidor Apache-ANT este funcionando:
Instalamos Red5 descargando la fuente desde subversion:
# cd /usr/src
# svn co http://red5.googlecode.com/svn/java/server/trunk red5
Construimos/compilamos Red5:
# cd red5
# ant prepare
# ant dist
Movemos Red5 al directorio final:
# cd ..
# mv red5 /opt/red5
Operando con Red5:
Iniciando el servicio por primera vez:
Verificamos que el servicio este arriba:
Si el servicio está arriba enhorabuena... ya esta funcionando, ahora necesitamos trabajar en el detalle fino y buenas prácticas.
Vamos a detener el servicio:
# cd /opt/red5/dist
# ./red5-shutdown.sh
Ahora vemos que el servicio no se encuentra activo:
Restauramos el servicio y le damos un vistazo a los logs:
# ./red5.sh > start.log &
Nos aseguramos de que el servicio esta arriba:
Volvemos a detener el servicio:
# cd /opt/red5/dist
# ./red5-shutdown.sh
Automatizamos el servicio:
Agregamos las siguientes líneas al final del archivo /etc/bashrc:
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
Claro, hay que verificar los respectivos paths.
Creamos el archivo red5 dentro del /etc/init.d con el siguiente 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=/opt/red5/dist
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
# above is 0 if you copy paste from this blog and this does not work just replace o above by #zero
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
Asignamos los permisos para hacerlo ejecutable (obvio verdad) y lo iniciamos.
Abrimos un navegador e ingresamos en http://ipdelservidor:5080
Para que se inicie al encender el servidor entramos en directorio "/etc/init.d/" y ejecutamos:
# chkconfig --add red5
# chkconfig --level 345 red5 on
Modo de uso:
# service red5 (start|stop|restart)
Reinicia tu servidor y el servicio se debe ejecutar automáticamente al encenderlo.
Nota:
No se recomienda realizar la instalación desde yum porque genera un error el paquete. Evita hacer esto, deja la flojera e instalalo a mano:
Class org.apache.tools.ant.taskdefs.ConditionTask doesn't support the nested "antversion" element
Referencias utilizadas:
http://mightydreams.blogspot.com/2010/06/installing-red5-on-centos-55-64-bit.html
http://www.chatroulette-clone.com/questions/faq/installing-red5-cpanel/
http://abdullahakay.blogspot.com/2010/07/red5-demo-error-trying-to-connect-to.html
http://www.chatroulette-clone.com/questions/faq/installing-red5-cpanel/
http://www.slideshare.net/gmoggia/red5-1685304