CentOS Installation OpenOffice Service

Source: Internet
Author: User

First step: Yum install Openoffice.org-brand openoffice.org-core openoffice.org-java-common xvfb openoffice.org-writer Openoffice.org-calc OPENOFFICE.ORG-L10N-ZH-CN OPENOFFICE.ORG-L10N-ZH-TW Python-uno Openoffice.org-draw Openoffice.org-impress

Step two: Start command:/usr/lib64/openoffice.org3/program/soffice--accept= "SOCKET,HOST=LOCALHOST,PORT=8100;URP; Staroffice.servicemanager "--norestore--nofirststartwizard--nologo--headless &
If the start succeeds, the service deployment is completed, and if the startup fails, the following error is required, which requires a third step.
/program/soffice.bin X11 Error:can ' t open display:
Set DISPLAY environment variable, use-display option
Or check permissions of your X-server
(See ' Man X ' resp. ' Man xhost ' for details)

Step three: Start as a service on CentOS
3.1 Need to install XVFB, is a virtual xserver
#yum Install XVFB
#yum Install xorg-x11-server-xvfb.x86_64

3.2 Creating a service startup script in/etc/init.d/
Below is the modified script content for CentOS 6.3

#vi/etc/init.d/soffice

#!/bin/bash

# Boot Open Office so this Alfresco can do transforms.
# chkconfig:2345 55 25
# Description:openoffice Headless
#
# Processname:soffice

# source Function Library
. /etc/rc.d/init.d/functions

Retval=0

vdisplay= ' 99 '
Soffice_path= '/usr/lib64/openoffice.org3/program '
Soffice_args1= "-nofirststartwizard-nologo-headless-display: $VDISPLAY"
Soffice_args2= '-accept=socket,host=localhost,port=8100;urp; Staroffice.servicemanager '
Soffice_pidfile=/var/run/soffice.bin.pid

Xvfb=/usr/bin/xvfb
xvfb_args= ": $VDISPLAY-screen 0 800x600x8-fbdir/var/run"
Xvfb_pidfile=/var/run/xvfb.pid
Start_soffice () {
Echo-n $ "Starting OpenOffice"
$SOFFICE _path/soffice.bin $SOFFICE _args1 $SOFFICE _args2 >/dev/null 2>&1 &
[$?-eq 0] && echo_success | | Echo_failure
Pidof soffice.bin > $SOFFICE _pidfile
Echo
}
Start_xvfb () {
Echo-n $ "Starting Xvfb"
$XVFB $XVFB _args >/dev/null 2>&1 &
[$?-eq 0] && Success | | Failure
Pidofproc Xvfb > $XVFB _pidfile
Echo
}
Start () {
Start_xvfb
Sleep 3
Start_soffice
}
Stop () {
Echo-n $ "Stopping OpenOffice"
Killproc Soffice.bin
Echo
Echo-n $ "Stopping XVFB"
Killproc XVFB
Echo
}
Case "$" in
Start
Start
;;
Stop
Stop
;;
Restart
Stop
Start
;;
*)
echo $ "Usage: $ {Start|stop|restart}"
Esac


#chmod +x/etc/init.d/soffice

#chkconfig Soffice on

#service Soffice Start

Ps-ef|grep Soffice

Fourth Step: Test:

/usr/local/jdk/bin/java-jar Jodconverter-2.2.2/lib/jodconverter-cli-2.2.2.jar Test.doc 1.pdf

Fifth step: Chinese garbled

Copy the Simhei.ttf and SIMSUN.TTC to the/usr/share/fonts directory, and then run the Fc-cache command to update the font cache. Then restart the Soffice service and re-test

CentOS Installation OpenOffice Service

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.