Koozali.org: home of the SME Server
Obsolete Releases => SME 8.x Contribs => Topic started by: newburns on June 10, 2012, 07:36:06 AM
-
This is how I installed Red5 on my SME 8 x64 build:
First up is Java >>> http://forums.contribs.org/index.php/topic,48744.new.html#new
Next up is ant >>>
Go here for latest version http://opensource.become.com/apache/ant/binaries/
or wget http://opensource.become.com/apache/ant/binaries/apache-ant-1.8.4-bin.tar.gz
tar -xvzf apache-ant-1.8.4-bin.tar.gz
mv apache-ant-1.8.4 /usr/local/ant
Now to set some variables (Please make sure these files are where you point them)
export JAVA_HOME=/usr/java/latest
export ANT_HOME=/usr/local/ant
echo 'export ANT_HOME=/usr/local/ant' >> /etc/bashrc
echo 'export JAVA_HOME=/usr/java/latest' >> /etc/bashrc
ln -s /usr/local/ant/bin/ant /usr/bin/ant
:::Now it is time to install Red5 Media Server:::
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5
mv -r red5 /usr/local/
cd /usr/local/red5
ant prepare
ant dist
make
cp -r dist/conf .
./red5.sh
Once you see
[INFO] [Launcher:/installer] org.red5.server.service.Installer - Installer service created
hit CTRL-C to exit. It will sort of stop there. Then
nano /etc/init.d/red5
and paste in
#! /bin/sh
#
# chkconfig: 345 85 15
# description: Controls Red5 Flash media server as a Linux service.
#
# red5 red5 initscript (adapted by Jez for RedHat/CentOS)
#
# Author: Simon Eisenmann <simon@struktur.de>
# Jeremy Morton <jez9999@gmail.com>
#
RETVAL=0
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="Red5 flash streaming server"
NAME=red5
RED5_HOME=/usr/lib/red5
DAEMON=$RED5_HOME/$NAME.sh
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
# Read config file if it is present.
if [ -r /etc/default/$NAME ]
then
. /etc/default/$NAME
fi
#
# Function that starts the daemon/service.
#
d_start() {
if [ -f /var/run/red5.pid ]; then
RED5PID=`cat /var/run/red5.pid`
RED5RUNNING=`ps -fp $RED5PID | grep $RED5PID`
if [ "$RED5RUNNING" != "" ]; then
echo "Can't start red5; already active (PID $RED5PID)..."
return 0
else
echo "Can't start red5; not active, but PID file (/var/run/red5.pid) has not been deleted."
return 1
fi
fi
mv /var/log/red5.log /var/log/red5_previous.log
cd $RED5_HOME
export LD_LIBRARY_PATH=$RED5_HOME/webapps/
su -c "$RED5_HOME/red5.sh > /var/log/red5.log 2>&1 & /bin/echo \$! > /var/run/red5.pid" root
RETVAL=$?
echo
return $RETVAL
}
#
# Function that stops the daemon/service.
#
d_stop() {
cd $RED5_HOME
$RED5_HOME/red5-shutdown.sh
RETVAL=$?
rm /var/run/red5.pid
echo
return $RETVAL
}
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
echo
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
echo
d_stop
echo "."
;;
restart|force-reload)
echo -n "Restarting $DESC: $NAME"
echo
d_stop
sleep 1
d_start
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
now CTRL-X and save.
chmod 755 /etc/init.d/red5
chmod +x /etc/init.d/red5
ln -s /etc/init.d/red5 /etc/rc.d/rc0.d/K02red5
ln -s /etc/init.d/red5 /etc/rc.d/rc1.d/K02red5
ln -s /etc/init.d/red5 /etc/rc.d/rc2.d/K02red5
ln -s /etc/init.d/red5 /etc/rc.d/rc6.d/K02red5
ln -s /etc/init.d/red5 /etc/rc.d/rc7.d/S98red5
And now to make it bootable
chkconfig red5 reset
It should be installed.chkconfig --list | grep red5
config set red5 service access public status enabled TCPPort 5080
signal-event remoteaccess-update
service red5 start
However I get this Starting Red5 flash streaming server: red5
mv: cannot stat `/var/log/red5.log': No such file or directory
bash: -c: line 0: syntax error near unexpected token `newline'
bash: -c: line 0: `/usr/local/red5/red5.sh > /var/log/red5.log 2>&1 & /bin/echo $! > '
.
Please Help
-
...
mv /var/log/red5.log /var/log/red5_previous.log
...
Try creating /var/log/red5.log first using:
touch /var/log/red5.log
-
Now I get this message (please note the spaces with the period at the end, is that normal?)
Starting Red5 flash streaming server: red5
bash: -c: line 0: syntax error near unexpected token `newline'
bash: -c: line 0: `/usr/local/red5/red5.sh > /var/log/red5.log 2>&1 & /bin/echo $! > '
.
Maybe someone can help me rewrite the service file? I don't understand it, and just copied and pasted from Red5 wiki
-
Confirm that red5 runs and works if you just run it manually using /usr/lib/red5/red5.sh (output logs will be sent to the console).
I found an alternative startup script here (http://nocreativity.com/blog/how-to-install-red5-on-centos-5-the-complete-guide).
-
Red5 does run. I can view the webpage, however, I cannot view the installer page for apps. I will tackle that once I get this startup script to work properly. I used the alternative script you posted, and saved my original as 'red5_backup'
However, I get this message.service red5 start
/etc/rc7.d/S98red5: line 50: stop: command not found
/etc/rc7.d/S98red5: line 50: restart: command not found
/etc/rc7.d/S98red5: line 50: status}.: command not found
I guess it is something with the stop, restart, and status commands. I think it has something to do with format, but I don't know the format.