Howtos:General

From Red5Tutorials

Jump to: navigation, search

Contents

Setting up Java for Linux (RedHat/Centos/etc) as root

  • Get the RPM package JDK 5.0 Update ‘xx’ (Java SE Development Kit (JDK)) from http://java.sun.com/javase/downloads
  • Install it with the command: rpm -i jdk-1_5_0_09-linux-i586.rpm
  • Add it to the environment by running the following shellscript (setup_jdk.sh):
#!/bin/sh
#
echo "Symlinking java"
( cd /usr/java ; ln -s jdk1.5.0_09 jdk )

echo "Making patches to profile"
cat > /etc/profile.d/java.sh <<EOF
PATH=/usr/java/jdk/bin:\$PATH
JAVA_HOME=/usr/java/jdk
export JAVA_HOME PATH
EOF

cat > /etc/profile.d/java.csh <<EOF
set path = ( /usr/java/jdk/bin \$path )
setenv JAVA_HOME /usr/java/jdk
EOF
  • Exit and re-enter the shell to make the changes effective
  • Test whether java is accessible by entering the command: java -version

Getting the Sources

SVN Client

First you need an appropriate SVN-Client

Connection Data

Now you need to setup a connection which can be retreived here.

Compiling Red5 server

Please check that you have set the right JAVA-Version in the build.properties file, have a look a the following lines to change:

 # Change this var to build to a different Java version
 java.target_version=1.5

or for 1.6.:

 # Change this var to build to a different Java version
 java.target_version=1.6

After that you need to change to the right directory (if not already happened). Most Terminals support drag n' drop, so type cd and drag the folder with the red5 sources into.

 cd path/to/red5

Compiling to a stand-alone server

Make sure there are no Red5 services running (e.g. NT/XP service) and compile with ant:

$ ant server

Compiling to a WAR file

With a WAR file you can easily deploy red5 in a Java server like Apache Tomcat.

$ svn checkout http://svn1.cvsdude.com/osflash/red5/java/server/trunk
$ cd trunk
$ ant
$ ant webwar

Note that 2 times `ant` is used. This is because `ant webwar` doesn't download all required dependencies (from googlecode) for a build.


After a succesful compilation you can find 'red5.war' in directory 'dist'.
(Compiling could take a while.)

I've tested it on: - Centos 4.4 / 5 - Java 6 (required) - Tomcat 5.5.20 / 6.0.13

Installing Red5 on SUSE Linux 10.0

http://osflash.org/red5/suse

Running the Server

With ant server the server is started automatically, which is useful when changing some source code (red5/ or own project). Otherwise you can use the shell script red5.sh which is inside the red5-dir. Just change to the red5 dir and type ./red5.sh, on Mac there's a simple App which only needs to be double-clicked.

Personal tools