วันพฤหัสบดีที่ 16 มกราคม พ.ศ. 2557

การติดตั้ง mcuWeb สำหรับ Ubuntu 11.10

การติดตั้ง mcuWeb สำหรับ Ubuntu 11.10


1. ทำการติดตั้ง  ubuntu 11.10  และแก้ไขไฟล์โดยใช้คำสั่ง nano  /etc/apt/sources,list

     เพิ่ม sources  เข้าไปในบรรทัดล่าง  ดังนี้

deb http://debian.pop-sc.rnp.br/debian/ squeeze main contrib non-free
deb-src http://debian.pop-sc.rnp.br/debian/ squeeze main

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

# squeeze-updates, previously known as 'volatile'
deb http://debian.pop-sc.rnp.br/debian/ squeeze-updates main contrib non-free
deb-src http://debian.pop-sc.rnp.br/debian/ squeeze-updates main

2. ติดตั้ง package ที่จำเป็น
apt-get install gcc make libncurses5-dev yasm g++ sun-java6-jdk checkinstall  libtheora-dev libvorbis-dev libssl-dev vim libgsm1-dev g++ make libtool yasm subversion git automake  subversion yasm autoconf pkg-config libxml2-dev libcurl4-openssl-dev

  

3.ทำการ download sailfin
cd /usr/local
wget http://download.java.net/javaee5/sailfin/v2_branch/promoted/Linux/sailfin-installer-v2-b31g-linux.jar
java -Xmx256m -jar sailfin-installer-v2-b31g-linux.jar
cd sailfin
chmod -R +x lib/ant/bin
lib/ant/bin/ant -f setup.xml

4.สร้างเพื่อให้  mcuWeb  รันทุกครั้งที่เปิดเครื่อง
nano /etc/init.d/mcuWeb

#! /bin/sh
### BEGIN INIT INFO
# Provides:          mcuWeb
# Required-Start:
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: mcuWeb startup script
# Description:       mcuWeb startup script
### END INIT INFO

# Author: Sergio Garcia Murillo “sergio.garcia@fontventa.com”

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Start Sailfin domian domain1"
NAME="asadmin"
DAEMON=/usr/local/sailfin/bin/$NAME
START_ARGS="start-domain domain1"
STOP_ARGS="stop-domain domain1"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME


#
# Function that starts the daemon/service
#
do_start()
{
        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
        $DAEMON $START_ARGS || return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
        # Return
        #   0 if daemon has been stopped
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        $DAEMON $STOP_ARGS || return 2
}

case "$1" in
  start)
        [ "$VERBOSE" != no ] && echo "Starting $DESC" "$NAME"
        do_start
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && echo "Done" ;;
                2) [ "$VERBOSE" != no ] && echo "Failed" ;;
        esac
        ;;
  stop)
        [ "$VERBOSE" != no ] && echo "Stopping $DESC" "$NAME"
        do_stop
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && echo "Done" ;;
                2) [ "$VERBOSE" != no ] && echo "Failed" ;;
    esac
        ;;
  restart|force-reload)
        #
        # If the "reload" option is implemented then remove the
        # 'force-reload' alias
        #
        echo "Restarting $DESC" "$NAME"
        do_stop
        case "$?" in
          0|1)
                do_start
                case "$?" in
                        0) echo "Done" ;;
                        1) echo "Old process is still running" ;; # Old process is still running
                        *) echo "Failed to start" ;; # Failed to start
                esac
                ;;
          *)
                # Failed to stop
                echo "Failed"
                ;;
        esac
        ;;
  *)
        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 3
        ;;
esac

สั่ง run
chmod +x /etc/init.d/mcuWeb
update-rc.d mcuWeb defaults

/etc/init.d/mcuWeb start


5.การเข้าใช้งาน GlassFish
http://[IP_DO_SERVIDOR]:4848
User: admin  
password: adminadmin




Config  HTTP
Configuration -> HTTP Service -> http-listener-1
โดยใช้ port  8090  และทำการ save



Confs สำหรับ SIP
Configuration -> SIP Container    ให้เปลี่ยนเป็น  5060  และ 5061
Configuration -> SIP Service -> SIP Listener ->
SIP Listener-1 เป็น 5060
 SIP Listener-2 เป็น 5061



Install MCU
http://sourceforge.net/projects/mcumediaserver/files/mcumediaserver/
โดย  install  ไฟล์ mcuWeb.sar


การ  Config 
http://[IP_DO_SERVIDOR]:8090/mcuWeb



Install MediaMixer
mkdir -p /usr/local/src
cd /usr/local/src

ทำการ download xmlrpc
http://sourceforge.net/projects/xmlrpc-c/files/Xmlrpc-c%20Super%20Stable/
http://sourceforge.net/projects/xmlrpc-c/files/
tar -xzvf xmlrpc-c-1.16.41.tgz

Speex
Speex é um codec de audio suportado pela aplicação, eu cheguei a implementar sem ele, mas vamos seguir as instruções do desenvolvedor
tar -xzvf speex-1.2rc1.tar.gz

mcumediaserver

mp4v2

ffmpeg

x264

Install & compile

x264
cd /usr/local/src/x264
./configure --enable-debug --enable-shared --enable-pic --disable-asm
make
make install
checkinstall --pkgname=x264 --pkgversion="0.2245-svn~checkinstall" --default

ffmpeg
cd /usr/local/src/ffmpeg
./configure --enable-shared --enable-gpl --enable-nonfree --disable-stripping
make
make install
checkinstall --pkgname=ffmpeg --pkgversion="4:0.10.1-svn~checkinstall" --default

xmlrpc-c
cd /usr/local/src/xmlrpc-c-1.25.23
./configure
make
make install
checkinstall --pkgname=xmlrpc-c --pkgversion="1.25.23-svn~checkinstall" --default

mp4v2
cd /usr/local/src/mp4v2/
autoreconf -fiv
./configure
checkinstall --pkgname=mp4v2 --pkgversion="1.9.1-svn~checkinstall" --default

speex
cd /usr/local/src/speex-1.2rc1
./configure
make
make install
checkinstall --pkgname=speex --pkgversion="1.2.1rc1~checkinstall" --default

cd /usr/local/
wget http://www.apache.org/dist//ws/xmlrpc/binaries/apache-xmlrpc-3.1.3-bin.tar.bz2
tar -xvf apache-xmlrpc-3.1.3-bin.tar.bz2

เปลี่ยนที่อยู่ apache-xmlrpc
nano /usr/local/src/mcu/XmlRpcMcuClient/nbproject/project.properties

file.reference.commons-logging-1.1.jar=/usr/local/apache-xmlrpc-3.1.3/lib/commons-logging-1.1.jar
file.reference.ws-commons-util-1.0.2.jar=/usr/local/apache-xmlrpc-3.1.3/lib/ws-commons-util-1.0.2.jar
file.reference.xmlrpc-client-3.1.3.jar=/usr/local/apache-xmlrpc-3.1.3/lib/xmlrpc-client-3.1.3.jar
file.reference.xmlrpc-common-3.1.3.jar=/usr/local/apache-xmlrpc-3.1.3/lib/xmlrpc-common-3.1.3.jar

nano /usr/local/src/mcu/mcuWeb/nbproject/project.properties

file.reference.commons-logging-1.1.jar=/usr/local/apache-xmlrpc-3.1.3/lib/commons-logging-1.1.jar
file.reference.ssa-api.jar=/usr/local/sailfin/lib/ssa-api.jar
file.reference.ws-commons-util-1.0.2.jar=/usr/local/apache-xmlrpc-3.1.3/lib/ws-commons-util-1.0.2.jar
file.reference.xmlrpc-client-3.1.3.jar=/usr/local/apache-xmlrpc-3.1.3/lib/xmlrpc-client-3.1.3.jar
file.reference.xmlrpc-common-3.1.3.jar=/usr/local/apache-xmlrpc-3.1.3/lib/xmlrpc-common-3.1.3.jar
file.reference.XmlRpcMcuClient.jar=../XmlRpcMcuClient/dist/XmlRpcMcuClient.jar

ทำการ  build
cd /usr/local/src/mcu/XmlRpcMcuClient
ant

cd /usr/local/src/mcu/mcuWeb
ant -Dj2ee.server.home=/usr/local/sailfin -Dlibs.CopyLibs.classpath=/usr/share/netbeans/java4/ant/extra/org-netbeans-modules-java-j2seproject-copylibstask.jar

MCU MediaMixer

cd /usr/local/src/mcu
make
make install
cd /usr/local/
ln -s /usr/local/mcu/

สร้าง ไฟล์ run mediamixer
nano  /etc/init.d/mediamixer

#! /bin/sh
### BEGIN INIT INFO
# Provides:          mcu
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: MCU Videomixer
# Description:       Starts and stops mcu Video Mixer
### END INIT INFO

# Do NOT "set -e"

# Media Mixer installation directory
MCU="/usr/local/mcu/bin/debug"
# Username to run application server
USER="root"
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="MCU Video Media Mixing Server"
DAEMON="${MCU}/mcu"
DAEMONPARAMS=""
SCRIPTNAME="mcu"

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

#
# Function that starts the daemon/service
#
do_start()
{
        echo -n "Starting $DESC:"
        cd $MCU && nohup $DAEMON $DAEMONPARAMS > /var/log/mcu 2>&1 &
        echo "Done"
}

#
# Function that stops the daemon/service
#
do_stop()
{
        echo -n "Stopping $DESC:"
        killall -9 mcu
        echo "Done"
}


case "$1" in
  start)
        do_start
        ;;
  stop)
        do_stop
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC"
        do_stop
        do_start
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 3
        ;;
esac

:


Run ตอน boot เครื่อง
chmod +x /etc/init.d/mediamixer
update-rc.d mediamixer defaults

/etc/init.d/mediamixer start

mcuWeb
http://[IP_DO_SERVIDOR]:8090/mcuWeb


Name: Qualquer coisa
Url: http://127.0.0.1:8080/mcu
Media IP: [IP_DO_SERVIDOR
Public IP: [IP_DO_SERVIDOR]


Config asterisk
nano   /etc/asterisk/sip.conf

[mcuWeb]
videosupport=yes
type=peer
host=127.0.0.1
port=5070
canreinvite=no
qualify=no
disallow=all
nat=no
allow=ulaw
allow=alaw
allow=speex
allow=h263
allow=h263p
allow=h264

Usuario com Video

[USUARIO]
type=friend
secret=SENHA
qualify=yes
port=5060
nat=yes
allow=h264
allow=h263
host=dynamic
dtmfmode=rfc2833
dial=SIP/114
context=videoconferencia
canreinvite=no




nano /etc/asterisk/extensions.conf

 [videoconferencia]
exten => _3XX,1,Dial(SIP/mcuWeb/${EXTEN})

Reload no asterisk

asterisk -rx "core reload"


Referencias

http://www.medooze.com
http://www.medooze.com/products/media-mixer-server/installation.aspx
http://sourceforge.net/projects/mcumediaserver/forums/forum/853498/topic/4760021
http://tesliuk.com/wiki/index.php/Video_Conferencia_com_Asterisk_e_MCU_Media_Server

การติดตั้ง openmcu สำหรับ FreeBSD

การติดตั้ง openmcu สำหรับ FreeBSD

การติดตั้ง mcu สำหรับ Ubuntu

MCU Service (Multipoint Control Unit service) เป็นระบบการประชุมทางไกลและติดต่อสื่อสารกับกลุ่มลูกค้าองค์กร ผ่านโครงข่ายสื่อสารข้อมูลความเร็วสูง เพื่อการประชุมและติดต่อสื่อสารในแบบโต้ตอบกัน (Interactive) ซึ่งจะทำให้สามารถพูดคุย ติดต่อสื่อสาร และประชุมกันได้โดยเห็นภาพ และการเคลื่อนไหวต่างๆ ของคู่สนทนา เสมือนการประชุมในห้องประชุมเดียวกัน บริการนี้จึงเปรียบได้กับสะพานเชื่อมที่เป็นตัวกลางในการส่งมอบเสียง, วิดีโอ, ข้อมูล และ/หรือโปรแกรมอื่นๆ ระหว่างการประชุมผ่านทางเครือข่าย นอกจากนี้บริการ MCU ยังสามารถเปลี่ยนแปลงการประชุมแบบ Point-to-Point เป็นการประชุมแบบ Multipoint ที่มีคุณสมบัติในการทำงานอื่นๆ ที่เหนือกว่าอีกด้วย

คุณสมบัติหลัก
  • รองรับรูปแบบการประชุมทางไกลทั้งแบบจุดต่อจุด  (Point To Point)และแบบหลายจุด (Point To Multipoint)
  • รองรับความเร็วในการรับส่งข้อมูลตั้งแต่ 128 Kbps - 384 Kbps
  • ไม่จำกัดปริมาณและชั่วโมงการใช้งาน
  • รองรับเทคโนโลยีการส่งข้อมูลภาพและเสียงตามมาตรฐาน ITU-T H.323 (IP Connection)
  • รองรับสัญญาณภาพ (Video Standards) ตามมาตรฐาน H.261, H.263, H.263+, H.264 และ VP8
  • รองรับสัญญาณเสียง (Audio Standards) ตามมาตรฐาน G.711, G.722, G.722.1, G.728 และ OPUS

การติดตั้ง mcu สำหรับ Ubuntu  ด้วยการทำตามขั้นตอนเพื่อให้การใช้งานให้มีประสิทธิภาพ เริ่มต้นด้วยการติดตั้ง package ที่สำคัญในการทำงาน

1. ทำการติดตั้ง yasm

2. ทำการติดตั้ง sofia-sip

3. ทำการติดตั้ง libvpx

4. ทำการติดตั้ง x264

5. ทำการติดตั้ง ffmpeg

6. ทำการติดตั้ง libyuv

7. เป็นการทำการติดตั้ง openmcu ตามลำดับ

การติดตั้ง openmcu สำหรับ CentOS

การติดตั้ง openmcu สำหรับ CentOS

เริ่มจากการติดตั้ง CentOS ให้เรียบร้อย

ปิดการทำงานของ firewall  ก็คือ ปิด iptables ดังนี้
 service iptables stop

ทำการติดตั้ง packages ที่จำเป็น
yum -y install libstdc+ freetye libjpeg-turbo


ทำการ download  ไฟล์ rpm  เพิ่มนำมาติดตั้ง

cd /root

wget http://ip-server/*.rpm

rpm -Uvh  *.rpm

เป็นอันสามารถใช้งานได้โดยเข้าตรวจสอบ  http://ip-server:1420

วันจันทร์ที่ 13 มกราคม พ.ศ. 2557

วิธีติดตั้ง Nginx, MySQL, PHP-FRM, phpMyAdmin (LEMP) บน CentOS


Nginx (Engine X) คือ Web Server ฟรี ประสิทธิภาพสูงรองรับการทำ reverse proxy ตลอดจน IMAP/POP3 Proxy Server โดย Nginx มีการพัฒนาในปี 2002 และเปิดตัวครั้งแรกในปี 2004 โดยตัว Nginx ถือว่าเป็น Web Server ที่มีประสิทธิภาพสูง และน่าสนใจเป็นอย่างมาก

PHP-FPM คือ FastCGI Process Manager เป็นอีกหนึ่งทางเลือกของ PHP FastCGI โดยตัว PHP-FPM นั้นถูกพัฒนาต่อยอดขึ้นมาเพื่อการประมวลผลเว็บไซต์ที่่มีความต้องการด้านประสิทธิภาพการทำงาน และความเร็วที่สูงกว่าปกติ

หมายเหตุ
บทความนี้จะสอนติดตั้ง Linux, Nginx, MySQL 5.5, PHP 5.1, phpMyAdmin 4.1 (LEMP) บน CentOS 6 แต่จะไม่ได้ลงรายละเอียดต่าง ๆ เช่น VirtualHost (VH) หรือ การปรับ Config Nginx เชิงลึก เป็นต้น

วิธีการติดตั้ง Linux CentOS 6


วิธีติดตั้ง Linux, Nginx, MySQL, PHP, phpMyAdmin (LEMP) บน Linux CentOS
1. ติดตั้ง Remi Repository
1
2
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

2. ติดตั้ง Nginx Repository
1
vi /etc/yum.repos.d/nginx.repo

เพิ่มข้อมูลเข้าไปในไฟล์ดังนี้
1
2
3
4
5
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

3. ติดตั้ง Ngnix, MySQL 5.5, PHP 5.4 & PHP-FPM
1
yum --enablerepo=remi,remi-test install nginx mysql mysql-server php php-common php-fpm phpmyadmin

4. ติดตั้ง Modules ที่จำเป็นให้กับ PHP
1
yum --enablerepo=remi,remi-test install php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-pecl-apc php-cli php-pear php-pdo

5. Start Service Nginx, MySQL, PHP-FPM
1
2
3
/etc/init.d/nginx start
/etc/init.d/mysqld start
/etc/init.d/php-fpm start

6. แก้ไขไฟล์ config Nginx
1
vi /etc/nginx/conf.d/default.conf

แก้ไขเป็นดังนี้
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.php index.html index.htm;
    }

    error_page  404              /404.html;
    location = /404.html {
        root   /usr/share/nginx/html;
    }

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        root /usr/share/nginx/html;
        try_files $uri =404;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
        include        fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    location ~ /\.ht {
        deny  all;
    }
}

7. ลิ้งค์ phpMyAdmin เข้ากับ Directory Web ของ Nginx (Default Web Root)
1
2
cd /usr/share/nginx/html/
ln -s /usr/share/phpMyAdmin/ phpmyadmin

8. กำหนด Username และ Password ให้กับ MySQL
1
mysqladmin -u root password 01234

9. แก้ไขให้สามารถเข้าถึง phpMyAdmin ได้จากเครื่องอื่น ๆ
1
vi /etc/httpd/conf.d/phpMyAdmin.conf

แก้ไขเป็น
1
2
3
4
<Directory /usr/share/phpMyAdmin/>
    order allow,deny
    allow from all
</Directory>

10. สร้างไฟล์ php เพื่อทดสอบการติดตั้ง
1
vi /usr/share/nginx/html/phpinfo.php

ใส่ข้อมูลเข้าไปในไฟล์ดังนี้
1
2
3
<?php
phpinfo();
?>

11. Restart Nginx 
1
/etc/init.d/nginx restart

12. ปิด Firewall (ปิดเพื่อการทดสอบเท่านั้น)
1
/etc/init.d/iptables stop

13. ทดสอบการติดตั้งโดยเปิดโปรแกรมเว็บเบราว์เซอร์แล้วพิมพ์ http://localhost/phpinfo.php



14. ทดสอบการติดตั้ง phpMyAdmin โดยเปิดโปรแกรมเว็บเบราว์เซอร์แล้วพิมพ์ http://localhost/phpmyadmin