
Setting up Red5, version 0.6.3 final, on Fedora Core 6.
踩踩 0作者:juzhax 发表日期:2008-01-12 复制链接 收藏
Setting up Red5, version 0.6.3 final, on Fedora Core 6.
Installing Red5, version 0.6.3 final takes 2 steps
1. Installing the Java 1.5 JDK
2. Installing Apache Ant.
3. Setting the wright Path Variables
4. Installing Red 5
First of all, you will need to be logged in as root. Were using bash as shell
Step 1. Installing the Java 1.5 JDK
The default Java jdk that comes with FC6 didn't work!
I havent't tested if the one that comes with FC6 by default does work. So I'll install it in the same way as on FC4
So the first thing we need to do is install the 1.5 jdk
You can find detailed instructions here or follow the short instructions below.
You will need to download the jdk 1.5 from java.sun.com.
Download the jdk-1_5_0_09-linux-i586.bin file, NOT the .rpm.
We will be building an rpm from the bin file.
Before we can do that we need to have fedora-rpmdevtools installed
Assuming you are in root's homedir
Copy code
[root@hostname ~]# yum install fedora-rpmdevtools
When installation is complete (and succeded) we build the rpmbuild tree
Copy code
[root@hostname ~]# fedora-buildrpmtree
Check to see if you have an rpmbuild directory:
Copy code
[root@hostname ~]# ls
Install jpackage.repo from JPackage,
change to the repos.d dir first
Copy code
[root@hostname ~]# cd /etc/yum.repos.d/
now get the jpackage.repo file from http://www.jpackage.org
Copy code
[root@hostname ~]# wget [url]http://www.jpackage.org/jpackage17.repo[/url]
If you have not yet downloaded the jdk-1_5_0_14-linux-i586.bin file (Linux self-extracting file), do so now.
You need a browser because you need to Click on Accept License Agreement.
Change to the directory where you downloaded the file
Copy code
[root@hostname ~]# cd download
Copy the jdk-1_5_0_19-linux-i586.bin to ~/rpmbuild/SOURCES/
Copy code
[root@hostname ~]# cp jdk-1_5_0_19-linux-i586.bin ~/rpmbuild/SOURCES/
Download java-1.5.0-sun-1.5.0.09-1jpp.nosrc.rpm from JPackage
Copy code
[root@hostname ~]# wget [url]http://mirrors.dotsrc.org/jpackage/1.7/generic/SRPMS.non-free/java-1.5.0-sun-1.5.0.14-1jpp.nosrc.rpm[/url]
Build a new java-1.5.0-sun-1.5.0.14-1jpp.i586.rpm
Copy code
[root@hostname ~]# rpmbuild --rebuild java-1.5.0-sun-1.5.0.14-1jpp.nosrc.rpm
Install the freshly built java packages.
First change to the RPMS directory.
Copy code
[root@hostname ~]# cd ~/rpmbuild/RPMS/i586/
Create yum-cmd:
Copy code
[root@hostname ~]# (echo config gpgcheck 0; echo localinstall java-1.5.0-sun*.rpm; echo run) > yum-cmd
And install from this file
Copy code
[root@hostname ~]# yum shell yum-cmd
When installation is complete you can remove the yum-cmd file:
Copy code
[root@hostname ~]# rm yum-cmd
Now let's check the Java version:
Copy code
[root@hostname ~]# java -version
It should read something like this:
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode)
That was step 1. Still here? let's go to step 2
Step 2. Installing Apache Ant.
Copy code
wget [url]http://apache.mirror.transip.nl/ant/binaries/apache-ant-1.7.0-bin.tar.gz[/url]
tar -zxf apache-ant-1.7.0-bin.tar.gz
mv apache-ant-1.7.0 /opt/ant
export ANT_HOME=/opt/ant
ln -s /opt/ant/bin/ant /usr/bin/ant
Step 3. Setting the wright Path Variables.
If you'll be running Red5 as root (which you shouldn't) you can add the paths to /root/.bash_profile
otherwise you can add them to /etc/profile add this line:
Copy code
[root@hostname ~]# export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.14/
Step 4. Installing Red5.
move back to your download directory:
Copy code
[root@hostname ~]# cd ~/download/
download Red5
Copy code
[root@hostname ~]# wget [url]http://dl.fancycode.com/red5/0.6.3/src/red5-0.6.3.tar.gz[/url]
Move to the direcotry destination where you want to put it, I use /opt/ and unpack
Copy code
[root@hostname ~]# cd /opt
[root@hostname ~]# tar zxf ~/downloads/red5-0.6.3.tar.gz
change into the red5-0.6.3
Copy code
[root@hostname ~]# cdred5-0.6.3
and use ant to build and run Red5
[code] [root@hostname ~]# ant
[root@hostname ~]# cd dist
[root@hostname ~]# sh ./red5.sh &[root@hostname ~]# ant
[/code]
If I'm not mistaken you should be up and running.
===================================================
#!/bin/sh
#
# Startup script for Red5 flash streaming server
#
# chkconfig: 345 81 81
# description: RED5 by java
#
# processname: java (unfortunately)
# pidfile: /var/run/red5.pid
# config: /etc/red5.conf
# Source function library.
. /etc/rc.d/init.d/functions
PID_FILE=/var/run/red5.pid
PID=`ps ax |grep java|grep red5|awk '{print $1;}'`
RETVAL=0
start() {
echo -n $"Starting $DESCR: "
# daemon java $OPTIONS > /dev/null 2>&1 &
export ANT_HOME=/opt/ant
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.14/
export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
exec $JAVA_HOME/bin/java -Djava.security.manager -Djava.security.policy=/opt/red5/conf/red5.policy -cp /opt/red5/red5.jar:conf:/opt/red5/conf org.red5.server.Standalone > /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
============================================
Move the file to the path: /etc/init.d
Execute the command at Terminal as super user: chkconfig --add red5
Updated by juzhax, 12-01-2008 for perak.org
Original from Patrick Gutlich
