New tutorials site for Red5

Link: http://www.red5tutorials.net

Just started but this WIKI styled Red5 tutorials site is made to get developers started in a practical way.

It contains:
- tutorials
- how tos
- frequently asked questions
- tips & tricks

Red5Tutorials.net

Inexpensive setup: Railo (ColdFusion), OpenLaszlo, Red5, MySql, CentOS

As a stiff ColdFusion developer since 1999 I've closely followed all developments in webworld from the angle 'Allaire, Macromedia and Adobe'.

During these years I've noticed that technology has become cheaper and many times even free.

Picture this. In the late nineties I used MS NT 4 server as a hosting box, MS SQL/Oracle as database engines and Allaire ColdFusion 4 as a webapplication server.
What do they have in common? They are all commercial products.

What does the software cost nowadays for a similar setup? 200 euros or less:
- NT 4 => Linux (e.g. Centos 4.x: it's free and 100% RedHat compatible);
- MS SQL / Oracle => MySQL 5 (views, triggers and stored procedures are supported nowadays!)
- Adobe ColdFusion => Railo (compatible with Adobe CF 6.1. Community edition is free, profession edition is 200 euros)

Total: 0 + 0 + 200 = 200 euros

But if you don't use search functions and CFX tags you can even save yourself the last 200 euros.

In my opinion today's opensource projects advance to the next level. Fundamental needs like developing an operating system or a database server are passed.
The new focus of opensource are business applications like OpenLaszlo (opensource Adobe Flex) and Red5 (free Adobe Flash Media Server).
Integrate that with popular webapplications like Joomla and Drupal and you can fulfill more business needs in less time.

In my future writings I'll walk you through real setups and configurations of these products.

Ruben

Installing Tomcat 5.5 with OpenLaszlo + Red5

This article explains how to install and run OpenLaszlo Presentation Server and Red5 Flash Server on top of an Apache Tomcat server (5.5).

I use the war files of OpenLaszlo and Red5 to do that. This way both servers nicely co-exist in Tomcat.

Read the article here (pdf): Installing Tomcat + Openlaszlo + Red5

How to make ColdFusion 7 unresponsive in just a sec

First of all the reason I publish this article is because for a few years I'm dealing with ColdFusion becoming unresponsive after running for a while.
And because I host several companies on a shared hosting environment I had no clue what code caused problems that led to unresponsiveness of ColdFusion 6 and 7.

This problem is still present in the latest updater released last week (version: 7.0.2, date: 06/28/2006) by Adobe.

OK, the following CFM code to hang ColdFusion has been tested on:
- Linux (Red Hat)
- ColdFusion 7 Standard Edition (version: 7.0.1 or 7.0.2)
Probably ColdFusion 6.x will hang too.
(help me make this list complete. e.g. enterprise edition? windows?)


<cfset myForever()>

<cfscript>
function myForever() {
while(1 EQ 1) {
calc = (8 * 7.3)/11.78;
}
}
</cfscript>

Simply request this page in your browser a few times until you reach the "maximum number of simultaneous requests". (CF Admin > Server Settings > Settings)

I will explain what happens.....
ColdFusion can handle a certain amount of requests simultaniously. To avoid unlimited loops and deadlocks in ColdFusion has a timeout mechanism. After a certain amount of seconds ColdFusion aborts running page-requests that are over due.

My experiment demonstrates that ColdFusion never aborts unlimited loops from User Defined Functions. But that's only true for UDF's made in cfscript.
If you transform the cfscripting to Cffunction-code it does timeout.

A note for Adobe:
I just found out today the way to reproduce this bug. That's the reason I couldn't report it to you for the 7.0.2 release!

Red5 start/stop init script on CentOS / RedHat Linux

The v0.41 release of Red5 contains a start/stop init script (/etc/init.d/red5 start) for Debian.
I'am running CentOS 4.x a 100% free and compatible alternative to RedHat ES.
There problems with the init script became clear.

Debian uses the function "start-stop-daemon()" to fire up services. As far as I know CentOS still uses "daemon()" to start services. Unfortunately, function daemon() is limited in its control....

The file attached contains my first attempt of a start/stop init script for CentOS. It's far from perfect but it's working.

Comments are welcome!

PS In the script I've added a RUNTIME user to avoid running as ROOT.


#!/bin/bash
#
# Startup script for Red5 flash streaming server
# Author: Ruben Waitz - www.amtex.nl
# Version 0.9 - 06/09/2006
#
# processname: java (unfortunately)
# pidfile: /var/run/red5.pid
# config: /etc/red5.conf

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

RED5_HOME=/opt/red5/
RUNTIME_USER=nobody
JAVACMD=/usr/java/jdk1.5.0_06/bin/java
OPTIONS="-cp ${RED5_HOME}red5.jar:${RED5_HOME}conf:$CLASSPATH org.red5.server.Standalone"
DESCR="Red5 flash streaming server"
PID_FILE=/var/run/red5.pid
PID=`ps ax |grep java|grep red5|awk '{print $1;}'`
RETVAL=0


# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

# Read config file if it is present.
if [ -r /etc/red5.conf ]
then
. /etc/red5.conf
fi


start() {
echo -n $"Starting $DESCR: "
# daemon $JAVACMD $OPTIONS > /dev/null 2>&1 &
su -p -s /bin/sh $RUNTIME_USER -c "\"$JAVACMD\" $OPTIONS" > /dev/null 2>&1 &
RETVAL=$?
[ $RETVAL = 0 ] && touch /var/lock/subsys/red5 && echo $!>$PID_FILE && echo_success
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $DESCR: "
#killproc $PID_FILE
[[ $PID != "" ]] && success && kill $PID || failure
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/red5 $PID_FILE
}


# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 3
start
;;
*)
echo $"Usage: $DESCR {start|stop|restart"
exit 1
esac

exit $RETVAL