安装目的:通过JAVA实现OFFICE在线预览
操作系统版本:Red Hat Enterprise Linux Server release 5.4 (Tikanga)
OPENOFFICE版本:OOo_3.3.0_Linux_x86_install-rpm_en-US.tar.gz
安装:
1.解压 tar -xzvf OOo_3.3.0_Linux_x86_install-rpm_en-US.tar.gz
2.解压后的目录为 OOO330_m20_native_packed-1_en-US.9567
3.在以下目录里看到如下四个东东 【licenses readmes RPMS update】
4.cd OOO330_m20_native_packed-1_en-US.9567/RPMS
5.rpm -ivh *.rpm
安装完成
使用:【启动SOFFICE服务,占用8100端口】
1.cd /opt/openoffice.org3/program
2. ./soffice -headless -accept="socket,host=localhost,port=8100;urp;" -nofirststartwizard&
查看是否启动成功
1. 执行 netstat -apn|grep 8100 ,会看到如下界面
tcp 0 0 127.0.0.1:8100 0.0.0.0:* LISTEN 8598/soffice.bin
2. 执行 ps -ax|grep openoffice,会看到如下界面
1 ? S 0:00 /bin/sh /opt/openoffice.org3/program/soffice -headless -accept=socket,host=localhost,port=8100;urp; -nofirststartwizard
2 ? Sl 0:03 /opt/openoffice.org3/program/soffice.bin -headless -accept=socket,host=localhost,port=8100;urp; -nofirststartwizard
启动成功。
为了方便启动和停止服务,在系统中增加了openoffice服务
启动:service openoffice start
停止:service openoffice stop
重起:service openoffice restart
服务脚本内容如下:
#!/bin/bash#Determine and execute action on command line parameter
JAVA_HOME="/xxx/jdk150_04"export JAVA_HOME
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jarexport CLASSPATH
PATH=$PATH:$HOME/bin:$JAVA_HOME/binexport PATH
OPENOFFICE_HOME=/opt/openoffice.org3export OPENOFFICE_HOME
case "$1" in start) echo "Starting Openoffice Server ..." ${OPENOFFICE_HOME}/program/soffice -headless -accept="socket,host=localhost,port=8100;urp;" -nofirststartwizard& sleep 10 ;; stop) echo "Shuting down Openoffice Server ..." ps -ax|grep openoffice.org3|grep -v grep| awk '{ print "kill -9 ", $1}'|sh sleep 2 ;; restart) service openoffice stop sleep 5 service openoffice start ;; *) echo "Usage:service openoffice {start|stop|restart}" exit 1esacexit 0
转载于:https://www.cnblogs.com/go2anywhere/archive/2013/03/08/2949190.html
相关资源:数据结构—成绩单生成器