You could setup apache2 on one IP (IP.AP.AC.HE) and Red5 on other IP dedicated (IP.DED.ICA.TED).
- The first file we need to modify is the server properties file located in the conf directory red5_path/conf/red5.properties:
sed "s/0.0.0.0/IP.DED.ICA.TED/g" red5_path/conf/red5.properties
- The second file we need to modify is the apache configuration file in the conf directory /etc/httpd/conf/httpd.conf (or /etc/apache2/apache2.conf):
sed "s/Listen 80/Listen IP.AP.AC.HE:80/g" /etc/httpd/conf/httpd.conf
- Now you must reboot server:
You could setup HTTP on port 80 and RTMPT on port 80 as well.
We need to modify is the server properties file located in the conf directory: red5_path/conf/red5.properties
- Locate the http.port key and change it to 80 instead of 5080
- Do not change the rtmpt.port entry, it should be 8088
- Save and close the file
- Download and Install Java. RED5 server depends on Java. CentOS 5.3 comes with OpenJDK 1.6 and install it using yum.
yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel
- Download and Install Ant (Apache Project). Ant will need to compile RED5 server code. Ant comes in binary form, so just download and install it in /usr/local directory.
tar jxvf apache-ant-1.8.0-bin.tar.bz2
mv apache-ant-1.8.0 /usr/local/ant
- Export Variables for Ant and Java
Also export these variables in /etc/bashrc to become available for every user login or for any terminal opens.
export ANT_HOME=/usr/local/ >> /etc/bashrc
export JAVA_HOME=/usr/lib/jvm/ >> /etc/bashrc
export PATH=$PATH:/usr/local/ant/ >> /etc/bashrc
export CLASSPATH=.:$JAVA_HOME/lib/classes. >> /etc/bashrc
- Download and Install RED5 Server. Here the latest version available for RED5 is 0.7 on site but download from google code using svn as the tarball of 0.7 on site is missing some of the files.
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5
mv red5 /usr/local/
- you will see a ton of lines, but you should get at last
this mean its install and now copy the conf directory from dist/ and test the red5 installation.
cp -r dist/conf .
If it shows Installer service created in the last then everything is fine here, press ctrl+c and move to next step to create init script.
- Before beginning this make sure you are running these commands as root. Install Subversion:
apt-get install subversion
- Install tools to build your own Debian packages:
apt-get install dpkg-dev
apt-get install debhelper
apt-get install dh-make
apt-get install devscripts
apt-get install fakeroot
- Install Java (see this tutorial for more info):
apt-get install java-package
- Install Apache Ant 1.7:
gzip -d xf apache-ant-1.7.0-bin.tar.gz
tar -xf apache-ant-1.7.0-bin.tar
mv apache-ant-1.7.0 /usr/local/ant
- Once Java and Ant are all set up you simply download the latest development version of Red5 to your box.
svn co http://svn1.cvsdude.com/osflash/red5/java/server/trunk red5-trunk
That will create a folder in your current directory called red5-trunk.
- Navigate to the red5-trunk directory and run
That will build the project on your machine.
- At this point you will need to create a red5 directory in the /usr/local/red5 directory.
- Then you will want to copy the contents of the dist(distribution) folder to /usr/local/red5 like so
cp -R red5-trunk/dist/* /usr/local/red5/
- We need need to fix the permissions on the red5.sh file:
chmod 755 red5.sh
- To run the server you have a few options using the red5.sh file. Run the server by either running
sh red5.sh &
This will start the Red5 service manually.
- Verify the correct ports are being bound to:
sudo apt-get update
sudo apt-get install subversion
sudo apt-get install java-package
sudo apt-get install sun-java6-jdk
sudo apt-get install ant
mkdir -p ~/svn/red5
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5-read-only
sudo mkdir /usr/share/red5
sudo cp -R * /usr/share/red5/
sudo chmod 755 red5.sh
Digit on browser: http://localhost:5080 and good luck!
Now we will create init script for red5 to start, stop and restart easily.
cp red5.txt /etc/init.d/red5
chmod 755 /etc/init.d/red5
Reference: corsidiinformaticaonline.it, red5server.org, sohailriaz.com