centos6.5安裝openoffice

一、openoffice 安裝

1、在官網http://www.openoffice.org/download/index.html, 下載最新版本Apache OpenOffice 4.1.2

#tar zxvf Apache_OpenOffice_4.1.2_Linux_x86-64_install-rpm_zh-CN.tar.gz

解壓後的目錄是zh-CN,裏面有RPMS、readmes、licenses。

2、進入RPMS目錄 

3、執行 rpm –ivh *rpm(安裝所有rpm文件)

4、進入到RPMS/desktop-integration目錄,選擇安裝相關的套件,我選擇的是redhat

#rpm -ivh openoffice4.1.2-redhat-menus-4.1.2-9782.noarch.rpm

這時openOffice己經安裝完成,默認會安裝在/opt

5、啓動openOffice服務 

臨時啓動: /opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard

 一直後臺啓動:nohup  /opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &

6、查看openoffice 默認的服務端口是否正常啓用

# netstat -tlnp |grep 8100

tcp        0      0 127.0.0.1:8100              0.0.0.0:*                   LISTEN      56236/soffice.bin   


二、安裝啓動完成後測試

1、下載jodconverter-2.2.2.zip,將其解壓到文件加下,
2、將test.doc拷貝到lib文件夾下
3、執行命令 java -jar jodconverter-cli-2.2.2.jar  test.doc test.pdf
4、如果生成pdf ,則openoffice安裝啓動成功


三、把啓動命令設置linux服務器啓動的時候默認加載

[root@okidea lib]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
#route add default gw 192.168.50.1
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard & 
touch /var/lock/subsys/local

       重啓服務器,netstat -tln監聽可以看到8100端口已經監聽,測試轉pdf也正常。另外設置可參考http://www.cnblogs.com/nerxious/archive/2013/01/18/2866548.html

。個人感覺這樣設置很簡單。


--------安裝遇到的問題和解決------原則是缺什麼補什麼包-----------------------

包的下載網站:http://pkgs.org/#centos-6

1、/opt/openoffice4/program/soffice.bin: error while loading shared libraries: libXext.so.6: cannot open shared object file: No such file or directory

找不到libXext.so.6文件,去系統裏面的/usr/lib64 或者 /usr/lib 查看有沒有這個文件,如果有就copy到/opt/openoffice4/program/目錄裏面,

賦予chmod 777  libXext.so.6 。如果沒有那麼要安裝該包。

由於我的系統是64位,那麼輸入yum install libXext.x86_64 ,如果是32位系統輸入:yum install libXext.i686  。安裝完成後去那兩個目錄找libXext.so.6複製到

/opt/openoffice4/program/目錄裏面,賦予chmod 777  libXext.so.6 。


2、 /opt/openoffice4/program/soffice.bin: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory

找不到libfreetype.so.6文件,同上輸入:yum install libfreetype.i686,安裝完之後去那兩個目錄找libXext.so.6複製到/opt/openoffice4/program/目錄裏面,賦予權限。


3、報問題:no suitable windowing system found, exiting.
輸入安裝:yum groupinstall "X Window System" ,一路安裝完之後重啓系統,在啓動openoffice服務看看。

使用yum groupinstall
先用yum grouplist 看需要裝那些包,一般x window gnome kde三個
Centos5和6改變比較大,需要注意命令是不一樣的
Centos5.x 系列
yum groupinstall "GNOME Desktop Environment" "X Window System"
Centos 6.x 系列
yum groupinstall "X Window System" "Desktop Platform"

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章