This howto was provided by Jake Hilton. If you see any errors please let him know so that they can be corrected. These instructions are generic enough to work on many different linux operating systems.
The following steps will install the development (trunk) version of red5.
Before beginning this make sure you are running these commands as root.
1.
You can create a red5 user to run this under if you don't plan on using any ports below 1000. If you need red5 to bind to ports below 1000 you need to run it as root. With the red5 user disallow login access and make the red5 user part of the root group.
2.
Make sure you have downloaded and installed the latest JDK from java.sun.com
*
For this tutorial just download the .bin file. All you need to do is change the permissions of that bin file to 755 with
chmod 755 jdk-1_6_0
and then execute it.
./jdk-1_6_0
or something similar. Then once it’s done you just copy the contents of the folder it made and put them in /usr/java/jdk1.6.0
*
Then set your JAVA_HOME variable. It may have to be set two different ways. First way:
JAVA_HOME=/usr/java/jdk1.6.0
and the second way.
export JAVA_HOME=’/usr/java/jdk1.6.0′
3.
Install Apache Ant 1.7. You may have to download that as well. Install the binary for it.
*
Download and unzip the file. Then copy the contents to a directory, something like /usr/ant. Then set your ANT_HOME variable. If it doesn't work then don't worry about it. We will not be using that pointer in this tutorial.
4.
Once java and ant are all set up you simply pull the latest trunk for red5 to your box.
svn co http://red5.googlecode.com/svn/java/server/trunk red5-trunk
That will create a folder in your current directory called red5-trunk.
5.
Navigate to the red5-trunk directory and run
/usr/ant/bin/ant
That will build the project on your machine.
6.
At this point you will need to create a red5 directory in the opt directory.
mkdir /opt/red5
7.
Then you will want to copy the contents of the dist(distribution) folder to /opt/red5 like so
cp -R red5-trunk/dist/* /opt/red5/
8.
We need to fix the permissions on the /opt/red5 directory like so:
chown -R red5 /opt/red5
9.
In addition we need need to fix the permissions on the red5.sh file like so:
chmod 755 red5.sh
10.
To run the server you have a few options using the red5.sh file. Navigate to /opt/red5 to make sure you are in the proper location. Then run the server by either running
sh red5.sh &
or
./red5.sh &
. This will start the red5 service manually. For a start and stop script look at the “Extra info” below.
11.
Run
netstat -ant
and verify the correct ports are being bound to. You may need to edit the red5.properties file in the /opt/red5/conf directory if you can’t connect to your server from an external location. Try to connect to the server before you modify the properties file because you may be able to connect to it with no problems.
12.
Extra info: The version compiled from source does not come with a start/stop script. I have put together one that will work with this how-to. If you run red5 as a different user this script will have to be tweaked. To put this script on your system do the following logged in as root:
cd /etc/init.d/
touch red5
chmod 755 red5
vi red5
then when you are in the red5 file push “i” to start inserting into that file and then put this code in by copying it and then pasting it with a right click of the mouse:
#! /bin/sh
#
# Author: Jake Hilton
# /etc/init.d/red5
#
# Check for missing file
RED5_DIR=/opt/red5
test -x $RED5_DIR/red5.sh || exit 5
case "$1" in
start)
echo -n "Starting Red5 Service"
echo -n " "
cd $RED5_DIR
su -s /bin/bash -c "$RED5_DIR/red5.sh &" red5
sleep 2
;;
stop)
echo -n "Shutting down red5"
echo -n " "
su -s /bin/bash -c "killall -q -u red5 java" red5
sleep 2
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
;;
esac
Then you can simply start, stop, and restart red5 from that script by typing:
/etc/init.d/red5 start
/etc/init.d/red5 stop
/etc/init.d/red5 restart
http://0.0.0.0:5080/
0 comments:
Post a Comment