一、安装JDK
进入http://java.sun.com/javase/downloads/index.jsp
下载Java SE Development Kit (JDK) 如:jdk-6u13-linux-i586.bin
上传到linux中/data0/software/下
设为可执行:
chmod +x /data0/software/jdk-6u13-linux-i586.bin
解压
/data0/software/jdk-6u13-linux-i586.bin
建立目录
mkdir -p /usr/local/java
拷贝到/usr/local/java/下:
mv jdk1.6.0_13 /usr/local/java/jdk
设置环境变量:
vi /etc/profile
在末尾加上如下代码并保存:
JAVA_HOME=/usr/local/java/jdk
CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME CLASSPATH PATH
使之生效:
source /etc/profile
测试是否成功:
java -version
二、安装ant
进入http://ant.apache.org/bindownload.cgi下载apache-ant-1.7.1-bin.tar.gz
传到/data0/software/下
解压:
tar zxvf /data0/software/apache-ant-1.7.1-bin.tar.gz
移到/usr/local/下:
mv /data0/software/apache-ant-1.7.1 /usr/local/ant
设置环境变量:
vi /etc/profile
加上:
ANT_HOME=/usr/local/ant
在PATH后添加:
:$ANT_HOME/bin
使之生效:
source /etc/profile
测试:
ant -version
三、安装perl uri
wget ftp://rpmfind.net/linux/dag/redhat/el2.1/en/i386/dag/RPMS/perl-URI-1.17-1.el2.rf.noarch.rpm
rpm –i perl-URI-1.17-1.el2.rf.noarch.rpm
yum install subversion
四、安装Red5
建立目录:
mkdir -p /usr/local/red5
下载:
svn co http://red5.googlecode.com/svn/java/server/trunk /usr/local/red5
安装:
cd /usr/local/red5
ant prepare
ant dist
设为开机启动:
vi /etc/rc.d/rc.local
在末尾加上下面代码并保存:
/usr/local/red5/dist/red5.sh &
建立服务:
mkdir -p /service
vi /service/red5
写上下面的代码并保存:
#!/bin/sh
# red5
# chkconfig: 2345 95 55
# description: red5 server startup script
# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
else
echo "Could not find functions file, your system may be broken"
exit 1
fi
# Source networking configuration.
if [ -f "/etc/sysconfig/network" ] ; then
. /etc/sysconfig/network
fi
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
red5_start()
{
echo -n "Starting red5: "
JAVA_HOME=/usr/local/java/jdk
ANT_HOME=/usr/local/ant
CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin
export JAVA_HOME CLASSPATH PATH
cd /usr/local/red5/dist/; sh red5.sh 2 >/dev/null &
echo_success
echo
touch /var/lock/subsys/red5
}
red5_stop()
{
echo -n "Shutting down red5: "
cd /usr/local/red5/dist/; sh red5-shutdown.sh 2 >/dev/null
echo_success
echo
rm -f /var/lock/subsys/red5
}
if [ "$1" = "start" ]; then
red5_start
elif [ "$1" = "stop" ]; then
red5_stop
else
printf "Usage: /service/red5 {start|stop}/n"
fi
exit 0
red5_start
elif [ "$1" = "stop" ]; then
red5_stop
else
printf "Usage: /service/red5 {start|stop}/n"
fi exit 0
设为可执行:
chmod +x /service/red5
启动/停止/重启:
/service/red5 start
/service/red5 stop
/service/red5 restart
查看进程:
ps aux | grep red5
访问地址:http://yourhost:5080/
安装功能页面:http://yourhost:5080/installer/
安装admin后设置密码
安装olfaDemo后测试视频
视频测试:http://yourhost:5080/demos/ofla_demo.html