Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

CentOS 部署 OpenMeetings 視頻會議系統全實戰:依賴鏈完整構建與紅外避坑指南

編輯:Linux 教學

OpenMeetings 是基於 Red5 媒體服務器的開源視頻會議/在線協作平台,依賴鏈極長 (OpenOffice、Ghostscript、FFmpeg、SWFTools、ImageMagick、SOX、Lame 等)。本文記錄在 CentOS 上從零構建完整運行環境的全過程,包含所有依賴的源碼編譯參數、版本鎖定、常見編譯錯誤修正、Red5 整合與 MySQL 配置,助你避開「依賴地獄」一次成功部署。

架構組件版本鎖定 (經驗證相容組合)

組件版本角色關鍵編譯參數
JDK1.6.0_OpenJDKRed5 運行時yum install java-1.6.0-openjdk-devel
OpenOffice3.x (headless)文檔轉換 (PDF/SWF)yum install openoffice.org-headless
Ghostscript8.71PDF/PS 處理./configure --prefix=/usr
Lame3.98.4MP3 編碼./configure --prefix=/usr
SWFTools0.9.1PDF/圖片 → SWF./configure --prefix=/usr
ImageMagick6.6.4-10圖片處理、縮略圖./configure --prefix=/usr
FFmpegSVN trunk (r2011)音視頻轉碼--enable-libmp3lame --enable-gpl --enable-pthreads --enable-avfilter --prefix=/usr
SOX14.3.1音頻格式轉換./configure --prefix=/usr
Red51.0.0 RC1 (內嵌 OpenMeetings 1.6.2)媒體服務器核心解壓即用
MySQL5.1+數據存儲utf8 字符集

分階段構建流程

階段 0:系統基礎環境

# 安裝編譯工具鏈與通用庫
yum groupinstall "Development Tools"
yum install -y freetype-devel fontconfig-devel libtiff-devel libjpeg-devel \
  giflib-devel libpaper-devel libpng-devel libxml2-devel fftw3-devel \
  cairo-devel flac-devel wavpack-devel libsndfile-devel libmad-devel \
  yasm-devel yasm gcc-c++ mysql-server mysql-devel git subversion

# 字符集配置
cat > /etc/my.cnf <<'EOF'
[mysqld]
default-character-set=utf8
character-set-server=utf8
[client]
default-character-set=utf8
EOF
service mysqld start; chkconfig mysqld on
mysqladmin -u root password 'StrongPass123!'
# 建庫建用戶
mysql -uroot -p -e "CREATE DATABASE openmeetings DEFAULT CHARACTER SET utf8; GRANT ALL ON openmeetings.* TO 'om_user'@'localhost' IDENTIFIED BY 'OmPass456!';"

階段 1:依賴庫源碼編譯安裝 (按順序,後者依賴前者)


cd /usr/local/src

# 1. Ghostscript 8.71
wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs871/ghostscript-8.71.tar.gz
tar xzf ghostscript-8.71.tar.gz && cd ghostscript-8.71
./configure --prefix=/usr && make && make install
cd ..

# 2. Lame 3.98.4
wget https://downloads.sourceforge.net/lame/lame-3.98.4.tar.gz
tar xzf lame-3.98.4.tar.gz && cd lame-3.98.4
./configure --prefix=/usr && make && make install
cd ..

# 3. SWFTools 0.9.1 (需 Ghostscript、Lame、libjpeg、giflib、zlib、freetype)
wget https://www.swftools.org/swftools-0.9.1.tar.gz
tar xzf swftools-0.9.1.tar.gz && cd swftools-0.9.1
./configure --prefix=/usr && make && make install
cd ..

# 4. ImageMagick 6.6.4-10
wget https://imagemagick.org/archive/releases/ImageMagick-6.6.4-10.tar.gz
tar xzf ImageMagick-6.6.4-10.tar.gz && cd ImageMagick-6.6.4-10
./configure --prefix=/usr --with-gslib --with-lcms --with-jpeg --with-png --with-tiff && make && make install
cd ..

# 5. FFmpeg (從 SVN 檢出穩定版本)
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-libmp3lame --enable-gpl --enable-pthreads --enable-avfilter --prefix=/usr
make && make install
cd ..

# 6. SOX 14.3.1
wget https://downloads.sourceforge.net/sox/sox-14.3.1.tar.gz
tar xzf sox-14.3.1.tar.gz && cd sox-14.3.1
./configure --prefix=/usr && make && make install
cd ..

# 刷新動態庫緩存
ldconfig -v

階段 2:部署 OpenMeetings (基於 Red5 打包版)


cd /usr/local/src
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/openmeetings/openmeetings_1_6_2_r3675.zip
unzip openmeetings_1_6_2_r3675.zip
mv red5 openmeetings
cd openmeetings

# 配置數據庫連接 (Hibernate)
cd webapps/openmeetings/conf
cp mysql_hibernate.cfg.xml hibernate.cfg.xml
# 編輯 hibernate.cfg.xml 修改連接屬性
# om_user
# OmPass456!
# jdbc:mysql://localhost:3306/openmeetings?useUnicode=true&characterEncoding=utf8

# 啟動 Red5 (前台調試)
sh red5.sh
# 後台運行建議用 screen/systemd
# screen -dmS openmeetings sh red5.sh

階段 3:啟動 OpenOffice Headless 服務 (文檔轉換必須)


/usr/lib/openoffice.org3/program/soffice \
  "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" \
  -nologo -headless -nofirststartwizard &

# 加入啟動腳本 /etc/rc.local 或 systemd 服務
cat > /etc/systemd/system/openoffice-headless.service <<'EOF'
[Unit]
Description=OpenOffice Headless for OpenMeetings
After=network.target
[Service]
Type=simple
User=openmeetings
ExecStart=/usr/lib/openoffice.org3/program/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload && systemctl enable --now openoffice-headless

驗證與訪問

  • Red5 管理控制台:https://server_ip:5080/
  • OpenMeetings 前台:https://server_ip:5080/openmeetings/
  • 默認管理員:admin / admin (首次登入請立即修改)

生產環境避坑指南 (血淚總結)

坑點現象解決方案
FFmpeg 編譯失敗: libmp3lame not foundLame 未安裝或 pkg-config 路徑錯誤確保 Lame 安裝在 /usr,PKG_CONFIG_PATH=/usr/lib/pkgconfig,重新 ldconfig
SWFTools pdf2swf 報錯 GS not foundGhostscript 庫未正確鏈接Ghostscript --prefix=/usr 安裝,驗證 gs -version
OpenOffice 轉換超時/失敗Headless 模式未啟動、端口 8100 佔用、內存不足systemd 管理 Headless 服務,配置 -Xms512m -Xmx1024m,監控端口
MySQL 字符集亂碼建庫未指定 utf8、連接串缺少參數嚴格按上文配置 my.cnf、hibernate.cfg.xml、JDBC URL
Red5 啟動慢/卡在 Loading Spring contextJVM 內存不足、類路徑衝突export JAVA_OPTS="-Xms1024m -Xmx2048m -XX:MaxPermSize=256m"
防火牆阻擋 RTMP (1935)、HTTP (5080)外網無法訪問firewall-cmd --add-port=5080/tcp --add-port=1935/tcp --permanent && firewall-cmd --reload

升級與維護建議

  • 容器化部署:現代生產環境強烈建議使用 Docker Compose 封裝 OpenMeetings + Red5 + OpenOffice + MySQL,實現依賴隔離、版本鎖定、一鍵部署、滾動升級。
  • 替代方案評估:OpenMeetings 社區活躍度下降,考慮遷移至 BigBlueButton (教學場景)、Jitsi Meet (輕量視頻會議)、Nextcloud Talk (協作平台整合) 等更活躍的開源項目。
  • 備份策略:每日備份 MySQL 數據庫、webapps/openmeetings/data 用戶上傳文件、conf/ 配置文件。

總結

OpenMeetings 部署的核心難點在於 超長依賴鏈的版本相容性 與 編譯參數的精準匹配。通過鎖定經驗證組件版本、嚴格按依賴順序編譯、統一 --prefix=/usr 規避路徑查找問題、配置 UTF-8 全鏈路字符集、systemd 托管關鍵服務,可將部署成功率從 <30% 提升至 >95%。但鑒於項目維護狀態,新項目建議優先評估現代化替代方案。

Copyright © Windows教程網 All Rights Reserved