2012年4月20日 星期五

RedHat Linux 上安裝 RPM 版本 LibreOffice 3.5


1. 解壓縮
tar zxvf [安裝檔名]
例如:
tar zxvf LibO_3.5.2_Linux_x86-64_install-rpm_en-US.tar.gz

2. 解壓縮的目錄會位於壓縮檔的相同路徑下
例如:
LibO_3.5.2_Linux_x86-64_install-rpm_en-US.tar.gz ← /user/home
LibO_3.5.2rc2_Linux_x86-64_install-rpm_en-US ← 也會在 /user/home

進入解完壓縮後的目錄
cd LibO_3.5.2rc2_Linux_x86-64_install-rpm_en-US/RPMS

並執行下列命令 (必須為 root 帳號)
rpm -Uvh *.rpm

3. 安裝完畢後的路徑
/opt/libreoffice3.5/program


4. 啟動 Service 指令(背景執行)
/usr/bin/nohup /opt/libreoffice3.5/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard 0</dev/null 1>/dev/null 2>/dev/null &



5. shell 檔案如下 (在 server 上啟動 Libre Office 的服務)

<startup_soffice.sh>
#!/bin/bash
# Update source files from Subversion and build them
#
# History
# 2012.04.20 GUC-Kaohung
# create this file

LibreOffice_HOME=/opt/libreoffice3.5/program/soffice.bin

# find tomcat PID
tomcatpid=`ps -ef | grep "$LibreOffice_HOME" | grep -v grep | awk '{print $2}'`
if [ -n "$tomcatpid" ]; then
kill -9 $tomcatpid
echo "LibreOffice3.5 service is stopped."
fi

/usr/bin/nohup /opt/libreoffice3.5/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard 0</dev/null 1>/dev/null 2>/dev/null &
echo "LibreOffice3.5 service is started."

<shutdown_soffice.sh>
#!/bin/bash
# Update source files from Subversion and build them
#
# History
# 2012.04.20 GUC-Kaohung
# create this file

LibreOffice_HOME=/opt/libreoffice3.5/program/soffice.bin

# find tomcat PID
tomcatpid=`ps -ef | grep "$LibreOffice_HOME" | grep -v grep | awk '{print $2}'`
if [ -n "$tomcatpid" ]; then
kill -9 $tomcatpid
echo "LibreOffice3.5 service is stopped."
fi

沒有留言:

張貼留言