ストリーミングサーバー RED5 インストール

この章を始める前に下記の設定が必要です
「ファイアウォール IPTABLES 設定」 「Apache2 インストール」
JDKインストール
[root@centos ~]# yum -y install java-1.8.0-openjdk
[root@centos ~]# yum -y install java-1.8.0-openjdk-devel
RED5インストール
[root@centos ~]# wget https://github.com/Red5/red5-server/releases/download/v1.0.6-RELEASE/red5-server-1.0.6-RELEASE-server.tar.gz
[root@centos ~]# tar zxvf red5-server-1.0.6-RELEASE-server.tar.gz
[root@centos ~]# mv red5-server-1.0.6-RELEASE /usr/local/red5
[root@centos ~]# rm -f red5-server-1.0.6-RELEASE-server.tar.gz
起動スクリプト作成
[root@centos ~]# vi /etc/init.d/red5
#!/bin/bash
# For RedHat and cousins:
# chkconfig: 2345 85 85
# description: Red5 flash streaming server
# processname: red5
# Created By: Sohail Riaz (sohaileo@gmail.com)

PROG=red5
RED5_HOME=/usr/local/red5
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid

# Source function library
. /etc/rc.d/init.d/functions

[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5

RETVAL=0

case "$1" in
	start)
	echo -n $"Starting $PROG: "
	cd $RED5_HOME
	$DAEMON >/dev/null 2>/dev/null &
	RETVAL=$?
	if [ $RETVAL -eq 0 ]; then
		echo $! > $PIDFILE
		touch /var/lock/subsys/$PROG
	fi
	[ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
	echo
	;;
	stop)
	echo -n $"Shutting down $PROG: "
	killproc -p $PIDFILE
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
	;;
	restart)
	$0 stop
	$0 start
	;;
	status)
	status $PROG -p $PIDFILE
	RETVAL=$?
	;;
	*)
	echo $"Usage: $0 {start|stop|restart|status}"
	RETVAL=1
esac

exit $RETVAL
[root@centos ~]# chmod 755 /etc/init.d/red5 [root@centos ~]# chkconfig --add red5
RED5起動
[root@centos ~]# /etc/init.d/red5 start
RED5終了する場合
[root@centos ~]# /etc/init.d/red5 stop
IPTABLES設定
[root@centos ~]# vi /root/iptables/iptables_setup.sh
↓下記を追加
############
### RED5 ###
############
iptables -A INPUT -p tcp --dport 1935 -j ACCEPT
iptables -A INPUT -p tcp --dport 5080 -j ACCEPT
[root@centos ~]# /root/iptables/iptables_setup.sh
テスト (http://www.ドメイン名:5080/ にアクセス)

1.「Install」をクリック。

2.「oflaDemo」を選択して「Install」をクリック。

3.「demo」をクリック。

4.「View demo」をクリック。

5.「rtmp://localhost/oflaDemo」を「rtmp://www.ドメイン名/oflaDemo」に変更。※ドメイン名は変更してください。
 「connect」をクリック。
 「toystory3.flv」をクリックするとTOY STORY 3のストリーミング再生ができます。
Home PageTop