電話会議システムを導入 @OpenMeetings

電話会議システム。Skypeのビデオがあかんから、急遽構築。
USBカメラのファームをUPしたらSkypeビデオ動いたので微妙だが、
業務利用できるくらいすばらしいシステム。

基本的に使い方を含めて以下を参考にすれば間違いない。
・OPEN SOURCE Wiki

OpenMeetingsインストール
http://wiki.open-art.jp/index.php/OpenMeetings%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB
OpenMeetingsユーザーズマニュアル
http://wiki.open-art.jp/index.php/OpenMeetings%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%82%BA%E3%83%9E%E3%83%8B%E3%83%A5%E3%82%A2%E3%83%AB

システム要件

結構シビア。Corei7 620M上で、MEM1GBのVM上で動いた。
・最低システム要件
CPU:1GHz、RAM:1GB(文書ファイル変換&録画機能&ファイルアップロード機能なし)
・推奨システム要件
CPU:Core/Quad 2GHz、RAM:4GB

必要な環境

Java JDK 6以上
MySql or Postgres(DBはTCP/IP接続できるもので、かつ文字コードUTF-8であること)
OpenOffice 3.0以上(OpenOfficeをサービス化(port:8100)。JODConverterで文書データ(excel>pdfなど)を変換)
ImageMagickJPEGファイルへ変換)
・GhostScript(ラスターイメージプロセッサ)
SWFTools(0.9以上)(SWFファイルへ変換)
FFMpeg(録画)※configureパラメータに'--enable-libmp3lame'を追加すること
SoX (音声データの変換。12.xxでは動作しない)

CentOSリポジトリで入手できないものは、RHEL等から取得しリビルドするため以下インストール。
rpm-build(パッケージリビルド)

JDK,OpenOffice.org導入

下記参照(OpenOffice.orgの導入と自動起動の設定のみ)
openmeetingsではJODConverterが同梱されている
 >openmeetings/webapps/openmeetings/jod/jodconverter-2.2.2.jar

ドキュメント変換サーバを導入 @JODConverter
http://d.hatena.ne.jp/machua/20101106/1289021611

ImageMagick、GhostScript導入

パッケージ導入

# yum install ImageMagick ghostscript
Installed:
  ImageMagick.i386 0:6.2.8.0-4.el5_5.3 
# rpm -q ghostscript
ghostscript-8.15.2-9.12.el5_5

SWFTools導入

CentOS 5.5でのバージョンは「0.8.1-1.el5.rf」なのでNG。Fedora13から取得。

ダウンロード
# cd /usr/src/redhat/SRPMS
# wget http://pikachu.2014.free.fr/public/swftools/swftools-0.9.1-1.fc13.src.rpm
ソースをインストールして、必要なパッケージ確認・導入
# rpm -ivh swftools-0.9.1-1.fc13.src.rpm
# cd /usr/src/redhat/SPECS
# cat swftools.spec |grep Build
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  fontconfig-devel
BuildRequires:  giflib-devel
BuildRequires:  lame-devel
BuildRequires:  libjpeg-devel
BuildRequires:  freetype-devel
...
# yum install libjpeg-devel fontconfig-devel giflib-devel gcc-c++
swftools.specの修正

PDFLib Liteは商用パッケージの為、ライセンスの関係でパッケージから外すようにする。
2箇所修正。

# vi swftools.spec
修正前:BuildRequires:  pdflib-lite-devel
修正後:BuildRequires:  freetype-devel

修正前:%{_bindir}/pdf2pdf
修正後:#%{_bindir}/pdf2pdf
リビルド・インストール
# rpmbuild -bb swftools.spec
# cd /usr/src/redhat/RPMS
# yum localinstall --nogpgcheck swftools-0.9.1-1.i386.rpm

Speex導入

ffmpegのリビルドで必須。CentOS 5.5リボジトリの「Speex 1.0.5-4.el5_1.1」では駄目だった。
RHEL6βからソースを取得してみた。

ダウンロード
# cd /usr/src/redhat/SRPMS
# wget http://ftp.redhat.com/redhat/rhel/beta/6/source/SRPMS/speex-1.2-0.12.rc1.1.el6.src.rpm
ソースをインストールして、必要なパッケージ確認・導入

必要な追加パッケージはなし。

# rpm -ivh nomd5 SRPMS/speex-1.2-0.12.rc1.1.el6.src.rpm 
# cd /usr/src/redhat/SPECS
リビルド・インストール
# rpmbuild -bb speex.spec
# cd /usr/src/redhat/RPMS/i386/
# yum localinstall --nogpgcheck speex-1.2-0.12.rc1.1.i386.rpm speex-devel-1.2-0.12.rc1.1.i386.rpm 

FFMpeg導入

RPMforgeのffmpeglameが無効になっているため、ソースからリビルドする

ダウンロード
# cd /usr/src/redhat/SRPMS
# wget http://apt.sw.be/redhat/el5/en/source/ffmpeg-0.5.2-2.el5.src.rpm
ソースをインストールして、必要なパッケージ確認
# rpm -ivh ffmpeg-0.5.2-2.el5.src.rpm
   1:ffmpeg                 警告: ユーザ dag は存在しません - root を使用します
警告: グループ dag は存在しません - root を使用します
########################################### [100%]
警告: ユーザ dag は存在しません - root を使用します
警告: グループ dag は存在しません - root を使用します

# cd /usr/src/redhat/SPECS/
# cat ffmpeg.spec |grep BuildRequires
BuildRequires: SDL-devel
BuildRequires: freetype-devel
BuildRequires: imlib2-devel
BuildRequires: opencore-amr-devel
BuildRequires: zlib-devel
%{!?_without_a52dec:BuildRequires: a52dec-devel}
%{!?_without_opencore_amr:BuildRequires: opencore-amr-devel}
#%{!?_without_vorbis:BuildRequires: libogg-devel, libvorbis-devel}
%{!?_without_faac:BuildRequires: faac-devel}
%{!?_without_faad:BuildRequires: faad2-devel}
%{!?_without_gsm:BuildRequires: gsm-devel}
%{!?_without_lame:BuildRequires: lame-devel}
%{!?_without_nut:BuildRequires: libnut-devel}
%{!?_without_openjpeg:BuildRequires: openjpeg-devel}
%{!?_without_texi2html:BuildRequires: texi2html}
%{!?_without_theora:BuildRequires: libogg-devel, libtheora-devel}
%{!?_without_x264:BuildRequires: x264-devel}
%{!?_without_xvid:BuildRequires: xvidcore-devel}
...
yum install SDL-devel imlib2-devel a52dec-devel amrnb-devel amrwb-devel faac-devel faad2-devel texi2html libtheora-devel x264-devel xvidcore-devel dirac-devel freetype-devel opencore-amr-devel lame-devel
<||

***Lameを有効にするため、SPECファイル編集
>||
# vi ffmpeg.spec
修正:L.141
修正前:%{!?_without_lame:--enable-libmp3lame} \
修正後:    --enable-libmp3lame \
リビルド・インストール
# rpmbuild -bb ffmpeg.spec
# yum localinstall --nogpgcheck ffmpeg-0.5.2-2.i386.rpm ffmpeg-libpostproc-0.5.2-2.i386.rpm

SoX導入

CentOS5.5のSoXのバージョンは12.18.1-1。公式では動作しないとのこと。
RHEL6のソースを取得しリビルドする

ダウンロード
# cd /usr/src/redhat/SRPMS/
# wget http://ftp.redhat.com/redhat/rhel/beta/6/source/SRPMS/sox-14.2.0-3.1.el6.src.rpm
ソースをインストールして、必要なパッケージ確認
# rpm -ivh --nomd5 sox-14.2.0-3.1.el6.src.rpm 
警告: sox-14.2.0-3.1.el6.src.rpm: ヘッダ V3 RSA/SHA256 signature: NOKEY, key ID f21541eb
   1:sox                    警告: ユーザ mockbuild は存在しません - root を使用します
警告: グループ mockbuild は存在しません - root を使用します
########################################### [100%]
警告: ユーザ mockbuild は存在しません - root を使用します
警告: グループ mockbuild は存在しません - root を使用します

# cd /usr/src/redhat/SPECS/
# cat sox.spec |grep BuildRequire
BuildRequires: libvorbis-devel
BuildRequires: alsa-lib-devel, libtool-ltdl-devel, libsamplerate-devel
BuildRequires: gsm-devel, wavpack-devel, ladspa-devel, libpng-devel
BuildRequires: flac-devel, libao-devel, libsndfile-devel, libid3tag-devel
BuildRequires: libtool
- spec file update: added BuildRequires: gsm-devel
///
# yum -y install libvorbis-devel  alsa-lib-devel libtool-ltdl-devel libsamplerate-devel gsm-devel wavpack-devel ladspa-devel libpng-devel flac-devel libao-devel libsndfile-devel libid3tag-devel libtool
○mockbuildについて
http://wiki.centos.org/FAQ/General/RebuildReleaseProcess
CentOS uses a mock buildroot environment (a separate chroot for each package), 
not unlike what is being done for Fedora or Scientific Linux. 
SL has been reported to use mock directly. 
Fedora uses mock with a program called koji CentOS uses mock via a program 
called plague All 3 solutions produce the same type of RPMS 
as rpmbuild is the underlying builder in each instance.
リビルド・インストール
# rpmbuild -bb sox.spec
# cd /usr/src/redhat/RPMS/i386
# yum localinstall --nogpgcheck sox-14.2.0-3.1.i386.rpm 

OpenMeeting 導入

ダウンロード・インストール
# wget http://openmeetings.googlecode.com/files/openmeetings_1_5_rc1_r3393.zip
# unzip openmeetings_1_5_rc1_r3393.zip
# mv red5 /usr/local/openmeetings
設定ファイル変更
# cd /usr/local/openmeeting/webapps/openmeetings/conf
# mv hibernate.cfg.xml hibernate.cfg.xml.org
# cp mysql_hibernate.cfg.xml hibernate.cfg.xml
# vi hibernate.cfg.xml

('hibernate.cfg.xml'の変更箇所)
※データベースへの接続ユーザー、接続パスワード、接続URIを変更する。
・・・
<property name="connection.username">openmeetings</property>
<property name="connection.password">パスフレーズ</property>
関連シェルスクリプトに対し実行権限付与
# cd /usr/local/openmeetings
# chmod +x *.sh
起動ユーザー登録
# useradd -d /usr/local/openmeetings openmeetings
所有者の変更

/usr/local/openmeetings ディレクトリ下の所有者&グループを openmeetings に変更

# chown -R openmeetings. /usr/local/openmeetings
自動起動スクリプト作成
# vi /etc/rc.d/init.d/openmeetings
#! /bin/sh
# chkconfig: 345 95 90
# description: Open Source Flash Server
# processname: java
# Author: OPEN-ART <info@open-art.jp>
# /etc/init.d/openmeetings

. /etc/rc.d/init.d/functions

NAME=openmeetings
RED5_DIR=/usr/local/$NAME
START_DAEMON=$RED5_DIR/red5.sh
STOP_DAEMON=$RED5_DIR/red5-shutdown.sh

# OpenMeetingsを'openmeetings'ユーザ以外で稼動させる必要がある場合は、
# 次のRUN_USER変数にそのユーザIDをセットしてください。
# ex.) RUN_USER=root
RUN_USER=$NAME

PIDFILE=/var/run/$NAME.pid
LOGFILE=/var/log/$NAME.log

test -x $START_DAEMON || exit 5

start() {
    echo -n "Starting OpenMeetings Service:"
    cd $RED5_DIR
    su -s /bin/bash -c "$START_DAEMON &" $RUN_USER >> $LOGFILE 2>&1
    RETVAL=$?
    echo
    [ $RETVAL = 0 ] && touch ${PIDFILE}
    sleep 2
    return $RETVAL
}

stop() {
    echo -n "Shutting down OpenMeetings:"
    cd $RED5_DIR
    su -s /bin/bash -c "$STOP_DAEMON &" $RUN_USER >> $LOGFILE 2>&1
    RETVAL=$?
    echo
    [ $RETVAL = 0 ] && rm -f ${PIDFILE}
    sleep 2
    return $RETVAL
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        start
        ;;
esac
実行権限付与
# chmod +x /etc/rc.d/init.d/openmeetings
サービスへ追加
# chkconfig --add openmeetings
# chkconfig openmeetings on
サービス起動
# service openmeetings start

セットアップ

WEBブラウザから以下に接続
http://Server:5080/openmeetings/install

"Continue with STEP 1"をクリックして進める。

ポート

5080 HTTP(Web公開用ポート)
1935 RTMP(Real Time Messaging Protocol)(Adobe社が開発したFlash技術用のストリーミング配信プロトコル
8088 RTMPT(RTMP over HTTP)(RTMPのHTTPトンネリング用)
8443 HTTPS、RTMPS(RTMP over SSL)(HTTP、RTMPSSLトンネリング用)
4445 Desktop Sharing