Is this Nethserver module helpful to you?
Please consider donating to the author

Thank you kindly!

2019/03/04 12:06 · HF

Onlyoffice (online office suite)

Onlyoffice document server is an open document editing server. It's used in Nextcloud or Webtop to edit office documents. You need to install Nextcloud or Webtop from Software Center to make this module work. Nethserver-nginx is installed as requirement. Self-signed certs are possible in Nextcloud (thanks to kizotux and flatspin) for test environments.

Onlyoffice documentserver needs port 8082 to be reachable. Just edit fw_onlyoffice access in services. It opens red and green by default.

Install Nextcloud or Webtop first to be able to use Onlyoffice.

yum -y install https://mrmarkuz.dynu.net/mirror/mrmarkuz/7/noarch/nethserver-mrmarkuz-0.0.1-6.ns7.noarch.rpm
yum -y install https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
yum -y install https://github.com/ONLYOFFICE/DocumentServer/releases/download/v7.3.3/onlyoffice-documentserver.x86_64.rpm
#yum -y install nethserver-onlyoffice --enablerepo=mrmarkuz
yum -y install https://mrmarkuz.dynu.net/mirror/devtest/nethserver-onlyoffice-0.0.3-1.ns7.noarch.rpm

mrmarkuz repo is required for installation/updates.

This way you always get the recent version but it may break something so choose wisely.

yum -y install https://download.onlyoffice.com/repo/centos/main/noarch/onlyoffice-repo.noarch.rpm

You have to install Nextcloud or Webtop from Software Center or via command line to actually use onlyoffice:

yum -y install nethserver-nextcloud
yum -y install nethserver-webtop5

In Webtop the documentserver does not work with the internal Webtop admin user.

Starting from documentserver 5.5.0 nodejs is not required anymore. Be careful as this step adds a repository that provides newer versions of nodejs that replaces the nodejs provided by centos which may lead to problems. I am working on nvm integration to not touch system packages.

curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
yum -y install https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm

At time of writing the latest version is 7.3.3. (please double check here)

yum -y install https://github.com/ONLYOFFICE/DocumentServer/releases/download/v7.3.3/onlyoffice-documentserver.x86_64.rpm

If you installed the onlyoffice repo just do

yum -y install onlyoffice-documentserver

Upgrade

Be careful that upgrades could break the installation, tested version is 7.3.3.

To upgrade an existing installation of documentserver issue:

yum upgrade https://github.com/ONLYOFFICE/DocumentServer/releases/download/vx.x.x/onlyoffice-documentserver.x86_64.rpm

Old upgrade path:

yum upgrade https://github.com/ONLYOFFICE/DocumentServer/releases/download/ONLYOFFICE-DocumentServer-x.x.x/onlyoffice-documentserver.x86_64.rpm

where 'x.x.x' would be the actual version you want to install. For an overview of available versions, please see: https://github.com/ONLYOFFICE/DocumentServer/releases/

Install nethserver-onlyoffice:

yum -y install nethserver-onlyoffice --enablerepo=mrmarkuz

Nextcloud addon is autoconfigured. If you installed Nextcloud after nethserver-onlyoffice just run

signal-event nethserver-onlyoffice-update

to setup the onlyoffice nextcloud app.

The host is set to HOST.DOMAIN.TLD by default. In Nextcloud 13 the FQDN only works with valid, not self-signed certificates. A token is used for securing the documentserver.

If you want to use a self signed certificate you have to change the configuration:

config setprop fw_onlyoffice RejectUnauthorized false

Apply the changes:

signal-event nethserver-onlyoffice-update

By default systemname.domainname is used. To change it do the following

config setprop fw_onlyoffice host DOMAIN.TLD

or use IP for self-signed certs

config setprop fw_onlyoffice host 1.2.3.4
  

and apply the config

signal-event nethserver-onlyoffice-update
Allow site in browser if self-signed cert is used

Browse to https://NETHSERVER:8082 and allow the site in your browser otherwise the documentserver may not work.

If something is not working it may help to click the “Save” button in the ONLYOFFICE app settings in the Nextcloud admin settings. At least you should get an error message.

If you downgraded/upgraded it may help to reinstall, just replace {VERSION} with 5.4.0-2 for example:

yum -y reinstall https://github.com/ONLYOFFICE/DocumentServer/releases/download/ONLYOFFICE-DocumentServer-{VERSION}/onlyoffice-documentserver.x86_64.rpm

After upgrades or downgrades it may make sense to drop the database to force recreation:

systemctl stop ds*:
su - postgres -c "psql -c 'drop database onlyoffice;'"
signal-event nethserver-onlyoffice-update

add

'allow_local_remote_servers' => true,

to /usr/share/nextcloud/config/config.php.

Maybe your DNS provides a local IP address for the Onlyoffice host. This way you can allow local network addresses.

If some documents open with an error regarding fonts you may recreate the fonts with

documentserver-generate-allfonts.sh

If you're using a reverse proxy that handles the certificate, it helps to disable cert validation.

config setprop fw_onlyoffice RejectUnauthorized false
signal-event nethserver-onlyoffice-update

Please raise Issues on NethServer Community