Document Server with Apache and MariaDB

Issues during installation and related to database
Post Reply
oldgoodname
Posts: 7
Joined: Wed Mar 31, 2021 12:35 pm

Document Server with Apache and MariaDB

Post by oldgoodname » Wed Apr 07, 2021 12:41 pm

Hi Guys,

on the offical installation instructions, the following 4 programs are requirements for the document server: NGINX, PostgreSQL, RabbitMQ and libstdc++6

I found a lot of posts and threads about using Apache or MariaDB/MySQL, but I found no final answer, if it is possible to use Apache instead of NGINX or/and MariaDB instead of PostgreSQL.

So my question is, is it possible to use Apache and MariaDB on a dedicated server with the onlyoffice document server even if it is not officially supported (just want to install it in a test-environment)? If so, is there a tutorial how to do that without installing NGINX and PostgreSQL and switch later to Apache and MariaDB?

I want to do that without using docker. Just 2 Debian servers (one with Apache and document server and one with MariaDB installed).

Thanks a lot and best regards

Alexandre
Posts: 221
Joined: Thu Dec 12, 2019 11:08 am

Re: Document Server with Apache and MariaDB

Post by Alexandre » Wed Apr 21, 2021 1:38 pm

Hello oldgoodname.
Please note, Document Server requires Nginx as a prerequisite.

As for using MySQL\MariaDB instead PostgreSQL. Technically, the Document Server supports working with it.
Please try to follow these actions:
1. For example, install MySQL and create user and database with the same credentials as when installing PostgreSQL.
2. Go to the host and open file default.json config file. It's located here: /etc/onlyoffice/documentserver/default.json
3. Find this section below:

Code: Select all

"sql": {
                                "type": "postgres",
                                "tableChanges": "doc_changes",
                                "tableResult": "task_result",
                                "dbHost": "localhost",
                                "dbPort": 5432,
                                "dbName": "onlyoffice",
                                "dbUser": "onlyoffice",
                                "dbPass": "onlyoffice",
                                "charset": "utf8",
                                "connectionlimit": 10,
                                "max_allowed_packet": 1048575,
                                "pgPoolExtraOptions": {}
- edit line "type": "postgres", to "type": "mysql", ;
- edit "dbPort": 5432, to "dbPort": 3306, ;
4. Execute command supervisorctl restart all and check the result.

oldgoodname
Posts: 7
Joined: Wed Mar 31, 2021 12:35 pm

Re: Document Server with Apache and MariaDB

Post by oldgoodname » Sun Apr 25, 2021 5:08 pm

Hi Alexandre,
thanks for your reply. I will install it with nginx and MariaDB and give it a try, but I'm a litte bit busy so I will do it during the next week.
Do I have to first install it with PostgreSQL and then install MariaDB and switch the connector, or is it possible to skip installation of PostgreSQL and install it without a DB and then later change it to MariaDB or will installation fail?

Thanks and best regards

oldgoodname
Posts: 7
Joined: Wed Mar 31, 2021 12:35 pm

Re: Document Server with Apache and MariaDB

Post by oldgoodname » Sat May 01, 2021 3:31 pm

Hi Alexandre,
I did a clean install of debian 10 and afterwards I installes documentserver with the follwoing tutorial: https://helpcenter.onlyoffice.com/insta ... 1587541027

So I did the following steps:

1. Install postgresql
2. Create DB (onlyoffice) and User (onlyoffice) with password onlyoffice and grant permissions
3. Install rabbitmq
4. Install nginx extras
5. Get the GPG keys
6. Add the repo -> and add contrib to the sources.list
7. Install ttf-mscorefonts
8. Install OO documentserver

Afterwards everything worked great (tried it with the built-in example). Because I want to later integrate it into nextcloud, SSL is necessary for me, so I generated a ssl-cert doing the following steps:

1. Install certbot
2. Generate ssl-cert with docs.domain.tld

Then I setup https using the following tutorial: https://helpcenter.onlyoffice.com/insta ... 1587541027

I did the following steps:

1. Stop nginy service
2. Copied the template file
3. Set the path for the cert and the keyfile to /etc/letsencrypt/live/docs.domain.tld/(cert.pem and privkey.pem)
4. In the https section, I added the following line: server_name docs.domain.tld

HTTPS works as expected, but now the documentserver function itself is broken. When I open an example-document, I get the following two error messages:

The document could not be saved. Please check connection settings or contact your administrator. When you click 'OK' button, you will be promted to download the document.

Download failed. Press "OK" to return to document list.

Any idea whats wrong? I want to try it with mariadb, but first it should work with postgresql.

thanks and best regards

Carl
Posts: 635
Joined: Thu Apr 12, 2018 10:00 am

Re: Document Server with Apache and MariaDB

Post by Carl » Mon May 03, 2021 7:39 am

Hello,

Please provide the Document Server log files /var/log/onlyoffice/documentserver/converter/out.log and .../docservice/out.log

Also please specify where you open the example document: is it the Example service or some DMS you integrated the Document Server with?

oldgoodname
Posts: 7
Joined: Wed Mar 31, 2021 12:35 pm

Re: Document Server with Apache and MariaDB

Post by oldgoodname » Mon May 03, 2021 2:32 pm

Hi Carl,
thanks for your answer. I think there was a dns-miconfiguration and so the documentserver used a false cert or so. Now the built-in example works after switch to https with an official let's encrypt cert.
So I switched to mariadb as guided by Alexandre. After a restart of the documentserver, everything still worked, but no table was created in the mariadb. So I don't know if it really works and the built-in example do not require a database.

So next step is to integrate it into nextcloud. I used this tutorial: https://helpcenter.onlyoffice.com/video ... cloud.aspx

Seems to be very easy, but it didn't work. A loading-sign was showing up the whole time in nextcloud. I checked the logs but found no errors. I know this is a little bit off-topic, but maybe you can help me or tell me, which is the right log I have to look at.

Thanks and best regards

Alexandre
Posts: 221
Joined: Thu Dec 12, 2019 11:08 am

Re: Document Server with Apache and MariaDB

Post by Alexandre » Tue May 04, 2021 10:28 am

Hello oldgoodname.
Please go to ONLYOFFICE connector page on Nextcloud portal and click Save button. Please show us the result.
Also try to open any file from Nextcloud with open browser console:
- Open browser console (for example, F12 in Chrome) -> choose ‘Network’ tab in browser console -> reproduce the issue (try to open the file) -> check if there are any error entries in console and make a screenshot;
- Choose ‘Console’ tab in browser console -> reproduce the issue -> check if there are any error entries in console and make a screenshot.
After that please attach Document server logs as Carl mentioned before. You can attach the whole logs folder: /var/log/onlyoffice/documentserver/

oldgoodname
Posts: 7
Joined: Wed Mar 31, 2021 12:35 pm

Re: Document Server with Apache and MariaDB

Post by oldgoodname » Tue May 04, 2021 6:26 pm

Hi Alexandre,
maybe I was not clear enough. When I go the the onlyoffice-app within nextcloud, I have to specify a documentserver and a secret, if configured. As I did the same steps as in the video, I typed in docs.domain.tld as well as mysecret. That should be correct, because I changed the default.json as in the video.

If I then hit the save-button, I get the loading-ring sign. So at this point, integration does not work, so I cant open a document or so. But I used the browser-console (network-tab) while hitting the save-button and I got a 403 Forbidden.

No one of both servers (documentserver and nextcloud) has a firewall activated and they are in the same vlan. So nothing should block the connection.

I found a site, where they say, it's necessary to add the following line to the config.php of nextcloud, but it didn't work:

'allow_local_remote_server' => true

So here are some logs, which may help:

Browser-console:

Request says:

[code
documentserver=https://docs.domain.tld
documentserverInternal=""
storageUrl=""
verifyPeerOff=false
secret=mysecret
demo=false
[/code]

converter-outlog

[ERROR] nodeJS - [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)

docservice-outlog

[WARN] nodeJS - Failed to subscribe to plugin folder updates. When changing the list of plugins, you must restart the server. https://nodejs.org/docs/latest/api/fs.h ... ailability

[ERROR] nodeJS - [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)

[WARN] nodeJS - Express server listening on port 8000 in production-linux mode. Version: 6.2.2. Build: 21


I hope that helps. Otherwhise I can attach the whole logs.

Thanks and best regards

Post Reply