Chapter 45. OpenOffice.org server installation

Table of Contents

45.1. Installation
45.1.1. Start server
45.1.2. Parameters
45.1.3. Installing an extension
45.1.4. Notes
45.2. Running OpenOffice as a Daemon
45.2.1. Nuxeo OOo Daemon
45.2.2. Configuring Nuxeo OOo Daemon

OpenOffice.org (OOo) is used on server-side for different tasks such as file transforms (eg. to PDF) or other advanced tasks.

45.1. Installation

See http://www.openoffice.org/ for installation procedure if not provided by your OS.

45.1.1. Start server

Since version 2.3, OpenOffice can be started in headless mode. This means that under linux, you non longer need to run a Xvfb.

Use the oooctl control script or, depending on your system and installation method, start OOo running :

  • for Linux:

    /path/to/openoffice/program/soffice.bin
                -headless -nofirststartwizard
    	    -accept="socket,host=localhost,port=8100;urp;StarOffice.Service"
  • for Mac OS X:

    /path/to/openoffice.app/Contents/MacOS/soffice.bin
                -headless -nofirststartwizard
    	    -accept="socket,host=localhost,port=8100;urp;StarOffice.Service"
  • for Windows:

    soffice.exe -headless
                -nofirststartwizard
    	    -accept="socket,host=localhost,port=8100;urp;StarOffice.Service"

45.1.2. Parameters

45.1.2.1. -headless

The -headless switch lets OOo manage to answer every question that may occur with a default response avoiding dead-locks. It also hides the OOo windows if a display is available by default (eg. Ms Windows). Note that the -invisible switch is not used as it is redundant and errors on PDF exports may occur.

45.1.2.2. -nofirststartwizard

The -nofirststartwizard skips any post-install wizard, allowing to use OOo directly after the installation without any user parameterization.

Install nxSkipInstallWizard.oxt extension to make this parameter permanent.

45.1.2.3. -accept

The UNO protocol implies that OOo is opened in listening mode on a network interface. This parameter let OOo listen on the right interface and port.

Install nxOOoAutoListen.oxt extension to set this listening permanent.

Alternate method: this could also be done by adding this connection info in OOo Setup.xcu configuration file.

<node oor:name="Office"> 
  <prop oor:name="ooSetupConnectionURL"> 
    <value>socket,host=localhost,port=8100;urp;StarOffice.Service</value> 
  </prop> 
</node>

45.1.3. Installing an extension

Nuxeo has developed some tools to ease the settings, they are available at the Nuxeo svn tools ooo section as extensions to install in OpenOffice. This can be done thru the GUI via the menu "Tools>Extensions Manager>Add..." or by opening the wanted extension with OpenOffice. To do it from a command line, run:

/path/to/openoffice/program/unopkg add extension.oxt

45.1.4. Notes

45.1.4.1. Multi-machine

On multi-machine deployment, we recommend to install OOo on the server running the webapp (ie stateless server on a bi-machine "stateless/stateful" installation).

45.1.4.2. OpenOffice lower than 2.3.x

For OOo versions lower than 2.3, a graphical interface is needed. If the server that hosts OOo is Linux server that has no X installed, then the X virtual frame buffer tool Xvfb (or xvfb-run depending of your distribution) can be used to create a suitable display.

Xvfb :77 -auth Xperm -screen 0 1024x768x24
export DISPLAY=":77.0"
xvfb-run -a /path/to/openoffice/program/soffice.bin
        -headless -nofirststartwizard
	-accept="socket,host=localhost,port=8100;urp;StarOffice.Service"

45.1.4.3. 32/64 bits

Note that the platform used for both the JVM and OOo have to be consistent to allow UNO protocol to work: with a 32 bits JVM, you'll have to use the 32 bits OOo version while the 64 bits one will be mandatory for a 64 bits JVM.

45.2. Running OpenOffice as a Daemon

45.2.1. Nuxeo OOo Daemon

Starting with 5.2-M4, Nuxeo includes a Daemon to start and manage OpenOffice server.

This daemon is based on the OpenOffice Server Daemon project

OOo Daemon provides :

  • OpenOffice server automatic startup

    Depending on configuration the OOo Server may be started automatically when Nuxeo starts or on first call.

  • OpenOffice server instances pooling

    Daemon can manage several OpenOffice instance (workers) and distribute tasks across them. In order to avoid leaks, OOo workers are recycled.

45.2.2. Configuring Nuxeo OOo Daemon

Configuration is done via an xml extension point. Defaut config can be editer in file located in nuxeo.ear/config/ooo-config.xml.

<?xml version="1.0"?>
<component name="org.nuxeo.ecm.platform.convert.oooDaemon.config.default">

  <extension target="org.nuxeo.ecm.platform.convert.oooserver.OOoDaemonManagerComponent"
    point="oooServerConfig">

  <OOoServer>
    <!-- enable Nuxeo Daemon to manage OOo server instances : default is true -->
    <enableDaemon>true</enableDaemon>
    <!-- define OOo server listen IP : used even if daemon is disabled -->
    <oooListenIP>127.0.0.1</oooListenIP>
    <!-- define OOo server listen port : used even if daemon is disabled -->
    <oooListenPort>8100</oooListenPort>
    <!-- define Daemon listen port : used only if daemon is enabled -->
    <oooDaemonListenPort>8101</oooDaemonListenPort>
    <!-- define number of OOo worker process : used only if daemon is enabled -->
    <oooWorkers>1</oooWorkers>

    <!-- define OOo installation path : used only if daemon is enabled -->
    <!-- if not defined Nuxeo will try to find the path automatically -->
    <!--<oooInstallationPath>/usr/lib/openoffice/program</oooInstallationPath>-->

    <!-- define jpipe library path : used only for OOo 3 -->
    <!--<jpipeLibPath>/opt/openoffice.org/ure/lib</jpipeLibPath>-->

    <!-- define number of time a worker process can be used before being recycled: used only if daemon is enabled -->
    <oooWorkersRecycleInterval>10</oooWorkersRecycleInterval>

    <!-- define is Daemon is started at server startup : used only if daemon is enabled -->
    <autoStart>false</autoStart>

  </OOoServer>

  </extension>

</component>

In most cases, you should not have to define the location of your OpenOffice installation as the Daemon will try to find it in the standard installation path.

If you want to use OpenOffice 3.x, you have to specify the jpipeLibPath in order to enable jpipe that is used by the Daemon to communicate with OpenOffice workers.