Memasang Red5 pada Debian

Versi terkini yang dipasang dengan tutorial ini:
Red5 1.0.0 RC2
Java 1.6.0_26
Ant 1.8.4

Sekurang-kurangnya Debian 5 (Lenny) diperlukan:
cat /etc/debian_version

Checkout release:
cat /proc/version
uname - a
cat /etc/issue
cat /etc/debian_version

Make sure system can find all require dependencies from /etc/apt/sources.list:
deb squeeze/updates main
deb-src squeeze/updates main
deb stable main non-free contrib
deb squeeze-updates main
deb-src squeeze-updates main
Comment any cd references with # if distribution cd is not inserted.

If system is not in English, enable that:
dpkg-reconfigure locales
export LANG=en_US.UTF-8

Update /etc/enviroment

You may need to reboot.


Kemas kini:
apt get update

Memasang Subversion:
apt-get -y install subversion

Install tools to build your own Debian packages:
apt-get -y install dpkg-dev debhelper dh-make devscripts fakeroot

Memasang Java (accept sun license if applies):
apt-get -y install java-package
apt-get -y install sun-java6-jre
apt-get -y install sun-java6-jdk

Memasang Apache Ant:
tar zxvf apache-ant-1.8.4-bin.tar.gz
mv apache-ant-1.8.4 /usr/local/ant
eksport ANT_HOME = / usr/tempatan/semut
/usr/local/ant/bin/ant -version

Download the latest development version of Red5:
SVN co red5-trunk

Run ant to build red5:
cd red5-trunk

Deploy red5:
mkdir /usr/local/red5
cp -R dist/* /usr/local/red5/
cd /usr/local/red5
chmod 755 RED5.SH

Deploy your custom apps in/usr/local/red5/webapps .
Dalam contoh VideoWhisper Red5 RTMP application needed to run VideoWhisper solutions.

Start Red5 in background:
cd /usr/local/red5
./RED5.SH >> red5.log &

Verify the correct ports are being bound to:
netstat -ant


You need to restart red5 each time you add webapps to /usr/local/red5/webapps or change configuration or restart server.

Close Red5:
cd /usr/local/red5

Or kill Red5 processes:
PS aux | grep red5
membunuh $process_id

Then start it again:
cd /usr/local/red5
./RED5.SH >> red5.log &


Can also deploy it as service to start automatically on server boot:

vi /etc/init.d/red5

#! /bin/sh
# put these contents at: /etc/init.d/red5
# change red5 directory path below as necessary

echo “Starting Red5 Service
sudo su root -ccd $RED5_DIR; ./RED5.SH > /var/log/red5.log &”

echo “Shutting down red5
sudo su root -c ‘killall red5 java

kes “$1” dalam
mula semula)
echo “Penggunaan: {mula|berhenti|mula semula}”
exit 1
exit $?

chmod +x /etc/init.d/red5

Red5 pelayan Linux pengoptimuman dan alat

Beberapa java pengoptimuman untuk menambah dalam :

eksport JAVA_OPTS =”-Xrs -Xms128M -Xmx256M -Dsun.rmi.dgc.client.gcInterval=300000 -Dsun.rmi.dgc.server.gcInterval=360000 -XX:+ExplicitGCInvokesConcurrent -XX:+UseConcMarkSweepGC -Xverify:Tiada seorang pun”

Assuming red5 was installed in /opt/red5/dist admin will often need to restart it or check if it’s running.

Make sure Red5 restarts:

#Restart the process
#First see if running
PID=`ps -eo ‘tty pid args’ | grep ‘red5’ | grep -v grep | grep -v restart | tr -s ‘ ‘ | cut -f2 -d‘`
CD /opt/red5/dist
Jika [ -z “$PID” ]
#not running
echo “Red5 was not running at `date`” >> /opt/red5/dist/run-restart.log
echo “Red5: $PID”
sleep 6
kill $PID >> null
sleep 2
/opt/RED5/Dist/RED5.SH >> /opt/red5/dist/red5.log &
echo “On request restarted Red5 at `date`” >> /opt/red5/dist/run-restart.log

Mare sure Red5 process is running, if not start it:

#set environment
PID=`ps -eo ‘tty pid args’ | grep ‘red5’ | grep -v grep | grep -v running | tr -s ‘ ‘ | cut -f2 -d‘`
Jika [ -z “$PID” ]
#Restart the process
CD /opt/red5/dist
/opt/RED5/Dist/RED5.SH >> /opt/red5/dist/red5.log &
echo “Restarted Red5 at `date`” >> /opt/red5/dist/run-restart.log
#do nothing
echo “Red5 is already running with PID=$PID at `date`” >> /opt/red5/dist/run-checked.log

Red5 Services
Red5 Hosting
Red5 installation on VPS & Dedicated Servers (Linux / Windows)