Howto install Onlyoffice document server as Nextcloud app

nextcloud
v7

(Dan) #21

So now that we have it working, is it possible to make it work without opening another port to the outside? I think Apache has some proxy functionality; couldn’t that be used to proxy https://neth_fqdn/documentserver to https://neth_fqdn:8082? I doubt it’d do anything for security, but it’d be helpful when dealing with firewalls that block non-standard ports.


(Markus Neuberger) #22

Fully agree.

I tried it but it didn’t work with Apache reverse proxy. It seems like you need another port or another IP.


(Matthieu Gaillet) #24

Out of curiosity, why didn’t you use the Docked version of Only Office ?


(Markus Neuberger) #25

I like to integrate things directly if possible, if this doesn’t work then docker/container/vm may be a good alternative. In this case (and in case of collabora too) docker may solve some problems so we should give it a try.


(Mark Edworthy) #26

I would love to see a similar tutorial that uses Apache and MySQL / MariaDB instead of Nginx and PostgreSQL


(Dan) #27

I believe OnlyOffice requires nginx and postgres (certainly the RPM does), so I don’t think that would be possible–though it does seem wasteful to be running two web and database servers.


(Paolo Bagnoli) #28

Great Work !
Wich is price for onlyoffice?

My best regards


(Alessio Fattorini) #29

Markuz and his friends should set the price :wink:
We are just waiting for an amazing module!


(Paolo Bagnoli) #30

Onlyoffice has an opensource version?


(Markus Neuberger) #31

Hi Paolo,

yes, it has:

https://www.onlyoffice.com/license-faq.aspx


(xcostax) #32

Hi, i’m new in the community.
I have a question about the connection to nextcloud/onlyoffice from outside.
To access onlyoffice from the outside, I had to enable the fw_onlyoffice service to accept the connections on the red.
What are the risks that I run to keep the service on red?

add firewall service

config set fw_onlyoffice service status enabled TCPPort 8082 access green red
signal-event firewall-adjust


(Markus Neuberger) #33

Hi @xcostax,

welcome to the NethServer community.

Usually the onlyoffice documentserver should run on default HTTPS port but as we already have apache running on that port we decided to change the nginx port to 8082 so I think it’s ok to open that port.

I didn’t read about security issues so far.


(xcostax) #34

Thank you mrmarkuz. Your work was very useful


(Ralf Jeckel) #35

@mrmarkuz Tried to install olyoffice on a upated NC13 with original NS certs.

When press save I get this error:

and from NC log:


(Markus Neuberger) #36

Thanks, with Nextcloud 13 it seems like you need a valid certificate, it doesn’t work with a self-signed cert, I already changed the howto…


(Ralf Jeckel) #37

Fixed the problem.

I inserted in /usr/share/nextcloud/config/config.php at the end of the array
’onlyoffice’ => array ( ‘verify_peer_off’ => TRUE)

So my config.php looks like:

<?php
$CONFIG = array (
  'passwordsalt' => 'm8MtZJRUJQcuEUBJgDmOZj1v9Vef0j',
  'secret' => 'LTOKh+dk9oGXzL1HPmxKo2SrfWJ0ViAhraF1obCda0anRPkB',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'ns7ad1.jeckel.lan',
    2 => '192.168.0.236',
    3 => '93.82.232.19',
  ),
  'datadirectory' => '/var/lib/nethserver/nextcloud/',
  'overwrite.cli.url' => 'http://localhost',
  'dbtype' => 'mysql',
  'version' => '13.0.0.14',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'loWZByQjtAHKRFDe',
  'installed' => true,
  'instanceid' => 'oczakujqudo2',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'maintenance' => false,
  'loglevel' => 2,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'onlyoffice' => array ( 'verify_peer_off' => TRUE)
);

Jippie ja je… :smile:


(Markus Neuberger) #38

Onlyoffice module available, please test before using in production…

https://wiki.nethserver.org/doku.php?id=onlyoffice


(Marc) #39

damn it, the like button falls short so… :heart_eyes: :heart_eyes: :heart_eyes:


(Marc) #40

Couldn’t make it work on a test server on VirtualBox using a self-signed certificate and Nextcloud 12.0.5.
Document server on port 8082 showed as working but nextcloud reported:

Error	PHP	file_get_contents(https://server.example.com:8082/coauthoring/CommandService.ashx): failed to open stream: operation failed at /usr/share/nextcloud/apps/onlyoffice/lib/documentservice.php#351

After some fiddling and a reboot nextcloud finally saved the https://fqdn:8082/ after several retries, but editing a document brings a blank page below the nextcloud top navigation bar. I bet I’m doing something wrong (to be continued in the morning).

Some excerpts from logs follow (including some warnings/errors from dependent packages that maybe could be obviated)

yum install (SELinux warnings/errors excluded):

ValueError: Port @tcp/3000 is not defined
ValueError: Port tcp/8000 already defined
ValueError: Port tcp/8080 already defined
warning: %post(onlyoffice-documentserver-5.0.7-38.x86_64) scriptlet failed, exit status 1
Non-fatal POSTIN scriptlet failure in rpm package onlyoffice-documentserver-5.0.7-38.x86_64

/var/log/messages:

Mar 17 00:36:33 server esmith::event[4210]: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.193144]
Mar 17 00:36:33 server esmith::event[4210]: could not change directory to "/root"
Mar 17 00:36:34 server esmith::event[4210]: CREATE DATABASE
Mar 17 00:36:34 server esmith::event[4210]: could not change directory to "/root"
Mar 17 00:36:34 server esmith::event[4210]: CREATE ROLE
Mar 17 00:36:34 server esmith::event[4210]: could not change directory to "/root"
Mar 17 00:36:34 server esmith::event[4210]: GRANT
Mar 17 00:36:34 server esmith::event[4210]: Created symlink from /etc/systemd/system/multi-user.target.wants/supervisord.service to /usr/lib/systemd/system/supervisord.service.
Mar 17 00:36:34 server systemd: Reloading.
Mar 17 00:36:34 server esmith::event[4210]: Created symlink from /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service to /usr/lib/systemd/system/rabbitmq-server.service.
Mar 17 00:36:34 server systemd: Reloading.
Mar 17 00:36:34 server systemd: Starting RabbitMQ broker...
Mar 17 00:36:34 server systemd: Cannot find unit for notify message of PID 4276.
Mar 17 00:36:34 server systemd: Cannot find unit for notify message of PID 4277.
Mar 17 00:36:34 server systemd: rabbitmq-server.service: Got notification message from PID 4279, but reception only permitted for main PID 4263
Mar 17 00:36:35 server systemd: Cannot find unit for notify message of PID 4300.
Mar 17 00:36:35 server systemd: rabbitmq-server.service: Got notification message from PID 4301, but reception only permitted for main PID 4263
Mar 17 00:36:35 server systemd: Cannot find unit for notify message of PID 4302.

Mar 17 00:36:41 server esmith::event[4210]: Trying to establish RabbitMQ connection... OK

Mar 17 00:36:43 server esmith::event[4210]: ValueError: Port tcp/9999 already defined

/var/log/onlyoffice/documentserver/gc/err.log:

events.js:160
      throw er; // Unhandled 'error' event
      ^

error: terminating connection due to administrator command
    at Connection.parseE (/var/www/onlyoffice/documentserver/server/DocService/node_modules/pg/lib/connection.js:567:11)
    at Connection.parseMessage (/var/www/onlyoffice/documentserver/server/DocService/node_modules/pg/lib/connection.js:391:17)
    at Socket.<anonymous> (/var/www/onlyoffice/documentserver/server/DocService/node_modules/pg/lib/connection.js:129:22)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:547:20)

/var/log/redis/redis.log:

5176:M 17 Mar 00:36:52.997 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
5176:M 17 Mar 00:36:52.997 # Server started, Redis version 3.2.10
5176:M 17 Mar 00:36:52.997 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
5176:M 17 Mar 00:36:52.997 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
5176:M 17 Mar 00:36:52.997 * DB loaded from disk: 0.000 seconds
5176:M 17 Mar 00:36:52.997 * The server is now ready to accept connections on port 6379

var/log/supervisor/supervisord.log:

2018-03-17 00:36:44,436 CRIT Supervisor running as root (no user in config file)


(Markus Neuberger) #41

Thanks for testing!

It seems to be another problem but did you apply this patch: