Cara Instalasi Red5 di CentOS 5.5

Red5 is an Open Source Flash Server written in Java that supports: Streaming Video (FLV, F4V, MP4), Streaming Audio (MP3, F4A, M4A), Recording Client Streams (FLV only), Shared Objects, Live Stream Publishing and Remoting.

Instalasi Red5:

  1. JDK: Instalasi
    yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel
  2. ANT:
    rm -rv /usr/local/ant
    
    cd /usr/src
    
    wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.1-bin.tar.bz2
    
    tar jxvf apache-ant-1.8.1-bin.tar.bz2
    
    mv apache-ant-1.8.1 /usr/local/ant
    
    
  3. VARIABLE SET
    export ANT_HOME=/usr/local/ant
    
    export JAVA_HOME=/usr/lib/jvm/java
    
    export PATH=$PATH:/usr/local/ant/bin
    
    export CLASSPATH=.:$JAVA_HOME/lib/classes.zip
    
    
  4. BASHRC
    echo 'export ANT_HOME=/usr/local/ant' >> /etc/bashrc
    
    echo 'export JAVA_HOME=/usr/lib/jvm/java' >> /etc/bashrc
    
    echo 'export PATH=$PATH:/usr/local/ant/bin' >> /etc/bashrc
    
    echo 'export CLASSPATH=.:$JAVA_HOME/lib/classes.zip' >> /etc/bashrc
    
    
  5. SVN: install
    yum -y install subversion
  6. SVN: Checkout
    rm -rv /usr/src/red5
    
    cd /usr/src
    
    svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5
    
    
  7. RED5: install
    rm -rv /usr/local/red5
    
    mv red5 /usr/local/
    
    cd /usr/local/red5
    
    ant prepare
    
    ant dist
    
    

    Perintah di atas akan menghasilkan baris-baris hasil compiler yang sangat panjang, yang penting baris terakhir harus berhasil sbb:

    [ivy:resolve]  [SUCCESSFUL ] red5#bcprov-jdk16;139!bcprov-jdk16.jar (45901ms)
    [ivy:resolve] :: resolution report :: resolve 24229ms :: artifacts dl 423607ms
    ———————————————————————
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ———————————————————————
    |       java6      |   56  |   12  |   0   |   0   ||   56  |   42  |
    ———————————————————————
    [ivy:retrieve] :: retrieving :: red5#server
    [ivy:retrieve]  confs: [java6]
    [ivy:retrieve]  56 artifacts copied, 0 already retrieved (30134kB/1887ms)
    [javac] /usr/local/red5/build.xml:257: warning: ‘includeantruntime’ was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 501 source files to /usr/local/red5/bin
    [javac] Note: /usr/local/red5/src/org/red5/io/FileKeyFrameMetaCache.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: /usr/local/red5/src/org/red5/io/object/Serializer.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.

    compile-core-compatibility:

    compile-demos:
    [echo] Webapps dir: webapps
    [echo] Webapps build dir: dist/webapps
    [copy] Copying 22 files to /usr/local/red5/dist/webapps/root
    [copy] Copying 23 files to /usr/local/red5/dist/webapps/root
    [copy] Copying 8 files to /usr/local/red5/dist/webapps/installer
    [copy] Copying 2 files to /usr/local/red5/dist/webapps/installer

    prepare:

    compile-script:
    [javac] /usr/local/red5/build.xml:349: warning: ‘includeantruntime’ was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 4 source files to /usr/local/red5/bin
    [javac] Note: /usr/local/red5/src/org/red5/server/script/rhino/RhinoScriptUtils.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [echo] Scripting compatibility is available.

    jar-determine-classpath:

    jar:
    [jar] Building jar: /usr/local/red5/red5.jar
    [jar] Building jar: /usr/local/red5/boot.jar

    dist:
    [copy] Copying 56 files to /usr/local/red5/dist/lib
    [copy] Copying 31 files to /usr/local/red5/dist/conf
    [copy] Copying 1 file to /usr/local/red5/dist/webapps
    [copy] Copying 11 files to /usr/local/red5/dist

    BUILD SUCCESSFUL
    Total time: 8 minutes 17 seconds
    [root@video red5]#

  8. RED5: start
    cp -r dist/conf .
    
    ./red5.sh
    
    
  9. RED4: startup script
    nano /etc/init.d/red5
    
    

    Isinya sbb:

    #!/bin/bash
    
    # chkconfig: 2345 80 80
    
    # description: Red5 streaming server
    
    # processname: red5
    
    
    
    . /etc/rc.d/init.d/functions
    
    
    
    [ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5
    
    
    
    RETVAL=0
    
    
    
    case "$1" in
    
    	start)
    
    	echo -n "Starting red5: "
    
    	cd /usr/local/red5
    
    	/usr/local/red5/red5.sh >/dev/null 2>/dev/null &&
    
    	RETVAL=$?
    
    	if [ $RETVAL -eq 0 ]; then
    
    		echo $! > /var/run/red5.pid
    
    		touch /var/lock/subsys/red5
    
    	fi
    
    	[ $RETVAL -eq 0 ] && success $"red5 startup" || failure $"red5 startup"
    
    	echo
    
    	;;
    
    	stop)
    
    	echo -n $"Stopping down red5: "
    
    	killproc -p /var/run/red5.pid
    
    	RETVAL=$?
    
    	echo
    
    	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/red5
    
    	;;
    
    	restart)
    
    	$0 stop
    
    	$0 start
    
    	;;
    
    	status)
    
    	status red5 -p /var/run/red5.pid
    
    	RETVAL=$?
    
    	;;
    
    	*)
    
    	echo $"Usage: $0 {start|stop|restart|status}"
    
    	RETVAL=1
    
    esac
    
    
    
    exit $RETVAL
    
    

    Set permission dan registasi service:

    chmod a+x /etc/init.d/red5
    
    chkconfig red5 on
    
    
  10. FIREWALL:
    nano /etc/sysconfig/iptables
    -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5080 -j ACCEPT
    
    -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1935 -j ACCEPT
    
    
    service iptables restart

    PENTING: jika anda ragu-ragu apakah firewall melakukan blocking maka selama troubleshoot matikan firewall dengan cara:
    – ketik: setup
    – pilih Firewall Configuration
    – Security Level=Disable, SELinux=Disable

  11. Test Red5:
    http://ip_adress_anda:5080/
    
    
  12. Selesai
Explore posts in the same categories: centos

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s


%d blogger menyukai ini: