FOSS document editing in Nextcloud
Microsoft Office was great, however we had to pay for it or use a pirate version. OpenOffice was great, too, however LibreOffice version of it had the source code open. And then, Google Drive came into appearance and made it possible to edit documents online. Their source code isn’t open. So I moved to Nextcloud and installed it on my own server. On that, I use a FOSS version of Microsoft Office that’s called ONLYOFFICE. Developed by Latvian Russians, that suite brings it all together that I need: the software is free, open-source, runnable on my own server and the user interface is user-friendly. I can’t do some things on it like I used to do with Kami in Google Drive but I hope to find an alternative for that, too. So, how in our holy green world did I set up ONLYOFFICE on my server?
I can’t remember how I did it. It run months before I had to restart the server machine. After that, I couldn’t open any files with ONLYOFFICE. Why? Because something did not come up automatically. As I don’t remember the installing process, I write down some important things that I remember.
I assume that Nextcloud is installed already.
I really don’t recommend to use either apt nor snap for installing ONLYOFFICE because it can screw up the whole system. The apt version demands removing mariadb and replace it by mysql which isn’t my way of doing things. Although both females seem to be nice, I haven’t met them, maria is more important as she’s opener. I wouldn’t give up on maria. The snap version creates a daemon that restarts nginx every time I kill it and can’t even run ONLYOFFICE. So I did the install manually.
I followed an official manual and decided to install ONLYOFFICE into docker using external storage and nginx as the reverse proxy. I also configured it with certbot for using HTTPS.
There’s another official manual that explaines other stuff that we need for ONLYOFFICE. I needed to set up mysql in docker:
sudo docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-mysql-server -p 4:4 -v /app/onlyoffice/mysql/conf.d:/etc/mysql/conf.d -v /app/onlyoffice/mysql/data:/var/lib/mysql -v /app/onlyoffice/mysql/initdb:/docker-entrypoint-initdb.d -v /app/onlyoffice/mysql/logs:/var/log/mysql -e MYSQL_ROOT_PASSWORD=<I don't want you to know my password> -e MYSQL_DATABASE=onlyoffice mysql:5.7
As the port 3306 is in use for mariadb, I needed another free port for mysql.
My command for creating a container for the document server:
sudo docker run --net onlyoffice -i -t -d --restart=always --name=onlyoffice-document-server -p 5:443 -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql onlyoffice/documentserver
As I want to run other sites served by nginx on the same machine and port as ONLYOFFICE, I need to make ONLYOFFICE run on a different port. In my example, docker’s port 5 will be directed to the host port 443.
I also needed to set up rabbitmq-server outside docker. So, inside docker, only two things run: onlyoffice-mysql-server and onlyoffice-document-server.
nginx reads the content of conf.d folder that has ds.conf which links to other configuration files of ONLYOFFICE that reside in /etc/onlyoffice/. I also had to create a dedicated domain for the document server.
Once, my home had a power failure and the server machine performed a restart. After that, I couldn’t use ONLYOFFICE anymore. It looked like the particular container wasn’t running. So I started the container and could enjoy ONLYOFFICE again.
A couple of days later, my had suffered another power failure. This time, the upper solution didn’t work. I saw the container running but ONLYOFFICE in Nextcloud kept showing the animated ONLYOFFICE logo. I couldn’t access the document server directly neither (172.18.0.1 appeared to be the Internet Protocol address of my docker container):
kalmer@test:~$ curl 172.18.0.1:443
<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>nginx</center>
</body>
</html>
kalmer@test:~$ curl 172.18.0.1:80
<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
kalmer@test:~$ curl 172.18.0.1:8080
curl: (7) Failed to connect to 172.18.0.1 port 8080: Connection refused
I wanted to confirm the correct port forwarding:
kalmer@test:~$ sudo docker inspect --format='{{ .NetworkSettings.Ports }}' 2907d44bfdea0755f8cea6aabaa48ecc57c27153f5ffb9c2cde5f2ee66f694ac
[sudo] password for kalmer:
map[443/tcp:[{0.0.0.0 5}] 80/tcp:[]]
So port 5 in the host computer was forwarded correctly to port 443 of the container. I tried to access the port 5:
kalmer@test:~$ curl http://localhost:5
curl: (56) Recv failure: Connection reset by peer
kalmer@test:~$ curl https://localhost:5
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:5
Restarting docker didn’t made anything better. I tested with the domain name:
kalmer@test:~$ curl http://test.tennis24.ee:5
curl: (7) Failed to connect to test.tennis24.ee port 5: Connection timed out
As it was obvious that the problem resides inside the container, I wanted to see the contents of the document server log file:
kalmer@test:~$ tail -f /var/log/onlyoffice/documentserver/docservice/out.log
[2020-07-28T01:33:05.831] [ERROR] nodeJS - [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
and the contents of the corresponding nginx file:
almer@test:~$ tail -f /var/log/onlyoffice/documentserver/nginx.error.log
2020/07/28 01:32:05 [error] 23791#23791: *451 connect() failed (111: Connection refused) while connecting to upstream, client: 80.235.6.91, server: onlyoffice.tennis24.ee, request: "GET /5.4.2-46//doc/2845378912/c/info?t=1595889125665 HTTP/1.1", upstream: "http://127.0.0.1:8000/doc/2845378912/c/info", host: "onlyoffice.tennis24.ee", referrer: "https://onlyoffice.tennis24.ee/5.4.2-46//web-apps/apps/spreadsheeteditor/main/index.html?_dc=5.4.2-46&lang=et-EE&customer=ONLYOFFICE&frameEditorId=iframeEditor"
2020/07/28 01:32:07 [error] 23791#23791: *451 connect() failed (111: Connection refused) while connecting to upstream, client: 80.235.6.91, server: onlyoffice.tennis24.ee, request: "GET /5.4.2-46//doc/2845378912/c/info?t=1595889127809 HTTP/1.1", upstream: "http://127.0.0.1:8000/doc/2845378912/c/info", host: "onlyoffice.tennis24.ee", referrer: "https://onlyoffice.tennis24.ee/5.4.2-46//web-apps/apps/spreadsheeteditor/main/index.html?_dc=5.4.2-46&lang=et-EE&customer=ONLYOFFICE&frameEditorId=iframeEditor"
2020/07/28 01:32:09 [error] 23791#23791: *451 connect() failed (111: Connection refused) while connecting to upstream, client: 80.235.6.91, server: onlyoffice.tennis24.ee, request: "GET /5.4.2-46//doc/2845378912/c/info?t=1595889129843 HTTP/1.1", upstream: "http://127.0.0.1:8000/doc/2845378912/c/info", host: "onlyoffice.tennis24.ee", referrer: "https://onlyoffice.tennis24.ee/5.4.2-46//web-apps/apps/spreadsheeteditor/main/index.html?_dc=5.4.2-46&lang=et-EE&customer=ONLYOFFICE&frameEditorId=iframeEditor"
So I decided to reinstall the docker version (official documentation):
kalmer@test:~$ wget https://raw.githubusercontent.com/ONLYOFFICE/Docker-CommunityServer/master/docker-compose.yml
--2020-07-28 02:42:54-- https://raw.githubusercontent.com/ONLYOFFICE/Docker-CommunityServer/master/docker-compose.yml
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.84.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.84.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3144 (3,1K) [text/plain]
Saving to: ‘docker-compose.yml’docker-compose.yml 100%[=======================================================>] 3,07K --.-KB/s in 0s2020-07-28 02:42:54 (23,9 MB/s) - ‘docker-compose.yml’ saved [3144/3144]
sudo docker-compose up -d
ended with error messages complaining about name conflicts. So I stopped and renamed the old containers. Next, I had to change all the port forwarding in docker-compose.yml for some free ports in the host computer. Finally, I took like forever and after forever, I got this error message:
kalmer@test:~$ sudo docker-compose up -d
WARNING: The MAIL_SERVER_HOSTNAME variable is not set. Defaulting to a blank string.
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).
I changed the timeout value to 120 by exporting the variables:
kalmer@test:~$ export DOCKER_CLIENT_TIMEOUT=120
kalmer@test:~$ export COMPOSE_HTTP_TIMEOUT=120
I restarted docker which took another forever. It didn’t change a shit as I got another error message that the timeout was still 60.
Then, I found another manual how to install ONLYOFFICE with snap. But wait, didn’t I write before that snap screwed up my website configurations? Well, it did and it also did this time kind of but I found a way to direct ONLYOFFICE into a different port:
kalmer@test:~$ snap install onlyoffice-ds
error: access denied (try with sudo)
kalmer@test:~$ sudo snap install onlyoffice-ds
onlyoffice-ds 5.4.0 from Ascensio System SIA (onlyoffice✓) installed
kalmer@test:~$ sudo snap set onlyoffice-ds onlyoffice.ds-port=270
[sudo] password for kalmer:
I also had to create the security certificate:
kalmer@test:/etc/nginx/sites-available$ sudo certbot --nginx -d onlyoffice.tennis24.ee
Now, only one problem remains: ONLYOFFICE currently runs on two ports: 80 and 270. This means that if node that servers ONLYOFFICE would start before nginx next time my home would suffer a power failure and nginx cry to death as its port 80 would be in use already. In order to avoid that sad emotion for nginx, I had to set the snap version of ONLYOFFICE to use the port 271 instead of 80:
kalmer@test:/etc/nginx/conf.d$ sudo snap set onlyoffice-ds onlyoffice.ds-port=271
[sudo] password for kalmer:
I’m not sure whether I could avoid the named port overlapping problem by that as although port 271 really responds with ONLYOFFICE stuff but 80 also still does that. Oh no, this is because 80 is still served from inside docker. And now, snap also tries to use 80. Once a day, I have to rerun the last command because then, snap does a restart to its nginx and frees the port 80 for the docker version. Probably, the community server failed and not document server during the install. It’s strange that in snap, I can’t see that its ONLYOFFICE is configured to run on port 271 although it still runs on that port. I stopped the snap container, so still, the docker version serves me hopefully fine.
It turned out that stopping isn’t enough, maybe disabling is.
Every day, I had to spend hours for figuring out why once again, ONLYOFFICE didn’t work. I did things without real knowledge. I turned out that docker didn’t have that ONLYOFFICE I was using. My ONLYOFFICE was installed probably using a DEB-file sitting in /var/www/onlyoffice.
I started over in a laptop that hadn’t ONLYOFFICE before. That laptop has Ubuntu 20.04.
I downloaded the fresh six days old DEB-file from the repository and tried to install it:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo dpkg -i onlyoffice-documentserver_amd64.deb
[sudo] password for peacecop:
Selecting previously unselected package onlyoffice-documentserver.
(Reading database ... 343099 files and directories currently installed.)
Preparing to unpack onlyoffice-documentserver_amd64.deb ...
Unpacking onlyoffice-documentserver (5.6.0-17) ...
dpkg: dependency problems prevent configuration of onlyoffice-documentserver:
onlyoffice-documentserver depends on mysql-client | mariadb-client; however:
Package mysql-client is not installed.
Package mariadb-client is not installed.
onlyoffice-documentserver depends on nginx-extras (>= 1.3.13); however:
Package nginx-extras is not installed.
onlyoffice-documentserver depends on postgresql-client (>= 9.1); however:
Package postgresql-client is not installed.
onlyoffice-documentserver depends on pwgen; however:
Package pwgen is not installed.
onlyoffice-documentserver depends on supervisor (>= 3.0b2); however:
Package supervisor is not installed.
onlyoffice-documentserver depends on xvfb; however:
Package xvfb is not installed.dpkg: error processing package onlyoffice-documentserver (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
onlyoffice-documentserver
I was surprised that this community version has a support for mariadb. I had lots of dependency problems, so I decided to give them a go starting by mariadb:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo apt install mariadb-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
onlyoffice-documentserver : Depends: nginx-extras (>= 1.3.13) but it is not going to be installed
Depends: postgresql-client (>= 9.1)
Depends: pwgen but it is not going to be installed
Depends: supervisor (>= 3.0b2) but it is not going to be installed
Depends: xvfb
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I couldn’t install it because of previous problems, so I did sudo apt --fix-broken install
which removed mariadb without asking. What a prick! In addition it complained:
psql: error: could not connect to server: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Obviously apt installed onlyoffice-documentserver and now, I wanted to get rid of it:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo apt purge onlyoffice-documentserver
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
mysql-client mysql-client-8.0 mysql-client-core-8.0 postgresql-client postgresql-client-12 postgresql-client-common pwgen supervisor
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
onlyoffice-documentserver*
0 upgraded, 0 newly installed, 1 to remove and 20 not upgraded.
1 not fully installed or removed.
After this operation, 1 004 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 355461 files and directories currently installed.)
Removing onlyoffice-documentserver (5.6.0-17) ...
Preparing for shutdown, it can take a lot of time, please wait...Done
Processing triggers for libc-bin (2.31-0ubuntu9) ...
(Reading database ... 343153 files and directories currently installed.)
Purging configuration files for onlyoffice-documentserver (5.6.0-17) ...
psql: error: could not connect to server: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
dpkg: warning: while removing onlyoffice-documentserver, directory '/etc/onlyoffice/documentserver' not empty so not removed
I went right away and reinstalled mariadb: sudo apt install mariadb-server
. Then, I tried to reinstall the DEB-package with the same errors as previously because the system was missing lots of dependencies. I did the same mistake again by trying to reinstall mariadb-client and went through fixing and purging and reinstalling mariadb-server again. And then:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo apt install onlyoffice-documentserver
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package onlyoffice-documentserver is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another sourceE: Package 'onlyoffice-documentserver' has no installation candidate
Of course not, because officially, it’s not part of Ubuntu.
This time, I didn’t want to remake my performed mistake and started to install the dependencies one by one:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo apt install mariadb-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
mariadb-client
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 12,5 kB of archives.
After this operation, 68,6 kB of additional disk space will be used.
Get:1 http://ee.archive.ubuntu.com/ubuntu focal/universe amd64 mariadb-client all 1:10.3.22-1ubuntu1 [12,5 kB]
Fetched 12,5 kB in 0s (122 kB/s)
Selecting previously unselected package mariadb-client.
(Reading database ... 343260 files and directories currently installed.)
Preparing to unpack .../mariadb-client_1%3a10.3.22-1ubuntu1_all.deb ...
Unpacking mariadb-client (1:10.3.22-1ubuntu1) ...
Setting up mariadb-client (1:10.3.22-1ubuntu1) ...peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo apt install postgresql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
postgresql-client-12 postgresql-client-common
Suggested packages:
postgresql-12 postgresql-doc-12
The following NEW packages will be installed:
postgresql-client postgresql-client-12 postgresql-client-common
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/1 074 kB of archives.
After this operation, 3 998 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Selecting previously unselected package postgresql-client-common.
(Reading database ... 343263 files and directories currently installed.)
Preparing to unpack .../postgresql-client-common_214_all.deb ...
Unpacking postgresql-client-common (214) ...
Selecting previously unselected package postgresql-client-12.
Preparing to unpack .../postgresql-client-12_12.2-4_amd64.deb ...
Unpacking postgresql-client-12 (12.2-4) ...
Selecting previously unselected package postgresql-client.
Preparing to unpack .../postgresql-client_12+214_all.deb ...
Unpacking postgresql-client (12+214) ...
Setting up postgresql-client-common (214) ...
Setting up postgresql-client-12 (12.2-4) ...
update-alternatives: using /usr/share/postgresql/12/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Setting up postgresql-client (12+214) ...
Processing triggers for man-db (2.9.1-1) ...peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo apt install pwgen
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
pwgen
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/18,1 kB of archives.
After this operation, 52,2 kB of additional disk space will be used.
Selecting previously unselected package pwgen.
(Reading database ... 343550 files and directories currently installed.)
Preparing to unpack .../pwgen_2.08-2_amd64.deb ...
Unpacking pwgen (2.08-2) ...
Setting up pwgen (2.08-2) ...
Processing triggers for man-db (2.9.1-1) ...peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo apt install supervisor
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
supervisor-doc
The following NEW packages will be installed:
supervisor
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/281 kB of archives.
After this operation, 1 682 kB of additional disk space will be used.
Selecting previously unselected package supervisor.
(Reading database ... 343555 files and directories currently installed.)
Preparing to unpack .../supervisor_4.1.0-1ubuntu1_all.deb ...
Unpacking supervisor (4.1.0-1ubuntu1) ...
Setting up supervisor (4.1.0-1ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.2) ...
As sudo netstat -plunt | grep :543
answered with emptyness, I had to install postgresql, too and after that, postgresql was running:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo netstat -plunt|grep post
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 143615/postgres
Could I install the DEB file now? Let’s see:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo dpkg -i onlyoffice-documentserver_amd64.deb
(Reading database ... 345214 files and directories currently installed.)
Preparing to unpack onlyoffice-documentserver_amd64.deb ...
Unpacking onlyoffice-documentserver (5.6.0-17) ...
Setting up onlyoffice-documentserver (5.6.0-17) ...
psql: error: could not connect to server: FATAL: password authentication failed for user "onlyoffice"
FATAL: password authentication failed for user "onlyoffice"
psql: error: could not connect to server: FATAL: password authentication failed for user "onlyoffice"
FATAL: password authentication failed for user "onlyoffice"
dpkg: error processing package onlyoffice-documentserver (--install):
installed onlyoffice-documentserver package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
onlyoffice-documentserver
There was no postgresql database present, so I had to create it with the credentials:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo -u postgres psql -c "CREATE DATABASE onlyoffice;"
CREATE DATABASEpeacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
CREATE ROLEpeacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
GRANT
Fine, the database with correct credentials was there. Did the DEB-install succeed this time? Let’s find out:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo dpkg -i onlyoffice-documentserver_amd64.deb
(Reading database ... 357543 files and directories currently installed.)
Preparing to unpack onlyoffice-documentserver_amd64.deb ...
Preparing for shutdown, it can take a lot of time, please wait...Done
Unpacking onlyoffice-documentserver (5.6.0-17) over (5.6.0-17) ...
dpkg: warning: old onlyoffice-documentserver package post-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: ... it looks like that went OK
Setting up onlyoffice-documentserver (5.6.0-17) ...
psql: error: could not connect to server: FATAL: password authentication failed for user "onlyoffice"
FATAL: password authentication failed for user "onlyoffice"
psql: error: could not connect to server: FATAL: password authentication failed for user "onlyoffice"
FATAL: password authentication failed for user "onlyoffice"
dpkg: error processing package onlyoffice-documentserver (--install):
installed onlyoffice-documentserver package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
onlyoffice-documentserver
Well, previously, as I made gave my first try for that DEB-file, I was asked for the password and I entered my own password. I could remember it via sudo DEBCONF_DEBUG=developer dpkg --configure onlyoffice-documentserver
which showed me that under debconf (developer): <-- GET onlyoffice/db-pwd
. So I had to alter the password for the user in the database with ALTER USER onlyoffice WITH password '
…
Was the DEB-install a success after this? Let’s find out:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo dpkg -i onlyoffice-documentserver_amd64.deb
(Reading database ... 357543 files and directories currently installed.)
Preparing to unpack onlyoffice-documentserver_amd64.deb ...
Preparing for shutdown, it can take a lot of time, please wait...Done
Unpacking onlyoffice-documentserver (5.6.0-17) over (5.6.0-17) ...
dpkg: warning: old onlyoffice-documentserver package post-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: ... it looks like that went OK
Setting up onlyoffice-documentserver (5.6.0-17) ...
Generating AllFonts.js, please wait...Done
Generating presentation themes, please wait...Done
Congratulations, the ONLYOFFICE documentserver has been installed successfully!
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Yey! It says: successfully! However, accessing localhost via web browser resulted with Bad request. So I went to see the logs: cd /var/log/onlyoffice/documentserver
. I wanted to see which log file I needed:
peacecop@peacecop-HP-ProBook-4520s:/var/log/onlyoffice/documentserver$ l -la
total 28
drwxr-xr-x 6 ds ds 4096 aug 3 23:47 ./
drwxr-xr-x 4 root root 4096 aug 3 23:46 ../
drwxr-xr-x 2 ds ds 4096 aug 3 23:47 converter/
drwxr-xr-x 2 ds ds 4096 aug 3 23:47 docservice/
drwxr-xr-x 2 ds ds 4096 aug 3 23:47 metrics/
-rw-r--r-- 1 root root 523 aug 3 23:47 nginx.error.log
drwxr-xr-x 2 ds ds 4096 aug 3 23:47 spellchecker/
It was nginx.error.log:
peacecop@peacecop-HP-ProBook-4520s:/var/log/onlyoffice/documentserver$ tail nginx.error.log
2020/08/03 23:47:49 [error] 146628#146628: *1 connect() failed (111: Connection refused) while connecting to upstream, client: ::1, server: , request: "GET /welcome/ HTTP/1.1", upstream: "http://127.0.0.1:8000/welcome/", host: "localhost"
2020/08/03 23:47:50 [error] 146628#146628: *1 connect() failed (111: Connection refused) while connecting to upstream, client: ::1, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8000/favicon.ico", host: "localhost", referrer: "http://localhost/welcome/"
It says that port 8000 is unoccupied and sudo netstate -plunt | grep :8000
confirms that. I thought that I had to bring the service up somehow using nodejs but memorized that some more dependencies were needed: rabbitmq-server and redis-server. I installed them and confirmed that these services were up and running:
peacecop@peacecop-HP-ProBook-4520s:/var/www/onlyoffice/documentserver/npm$ sudo systemctl status rabbitmq-server.service
● rabbitmq-server.service - RabbitMQ Messaging Server
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-08-04 00:24:53 EEST; 1min 12s ago
Main PID: 149269 (beam.smp)
Status: "Initialized"
Tasks: 91 (limit: 9286)
Memory: 76.1M
CGroup: /system.slice/rabbitmq-server.service
├─149265 /bin/sh /usr/sbin/rabbitmq-server
├─149269 /usr/lib/erlang/erts-10.6.4/bin/beam.smp -W w -A 64 -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 ->
├─149529 erl_child_setup 65536
├─149562 inet_gethost 4
└─149563 inet_gethost 4aug 04 00:24:47 peacecop-HP-ProBook-4520s systemd[1]: Starting RabbitMQ Messaging Server...
aug 04 00:24:53 peacecop-HP-ProBook-4520s systemd[1]: rabbitmq-server.service: Supervising process 149269 which is not our child. We'll mos>
aug 04 00:24:53 peacecop-HP-ProBook-4520s systemd[1]: Started RabbitMQ Messaging Server.
aug 04 00:25:01 peacecop-HP-ProBook-4520s systemd[1]: rabbitmq-server.service: Supervising process 149269 which is not our child. We'll mos>
aug 04 00:25:20 peacecop-HP-ProBook-4520s systemd[1]: rabbitmq-server.service: Supervising process 149269 which is not our child. We'll mos>
aug 04 00:25:21 peacecop-HP-ProBook-4520s systemd[1]: rabbitmq-server.service: Supervising process 149269 which is not our child. We'll mos>
aug 04 00:25:21 peacecop-HP-ProBook-4520s systemd[1]: rabbitmq-server.service: Supervising process 149269 which is not our child. We'll mos>
aug 04 00:25:22 peacecop-HP-ProBook-4520s systemd[1]: rabbitmq-server.service: Supervising process 149269 which is not our child. We'll mos>
aug 04 00:25:23 peacecop-HP-ProBook-4520s systemd[1]: rabbitmq-server.service: Supervising process 149269 which is not our child. We'll mos>peacecop@peacecop-HP-ProBook-4520s:/var/www/onlyoffice/documentserver/npm$ sudo systemctl status redis-server.service
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-08-04 00:25:22 EEST; 1min 7s ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Main PID: 151482 (redis-server)
Tasks: 4 (limit: 9286)
Memory: 2.3M
CGroup: /system.slice/redis-server.service
└─151482 /usr/bin/redis-server 127.0.0.1:6379aug 04 00:25:22 peacecop-HP-ProBook-4520s systemd[1]: Starting Advanced key-value store...
aug 04 00:25:22 peacecop-HP-ProBook-4520s systemd[1]: redis-server.service: Can't open PID file /run/redis/redis-server.pid (yet?) after st>
aug 04 00:25:22 peacecop-HP-ProBook-4520s systemd[1]: Started Advanced key-value store.
I also checked their ports:
peacecop@peacecop-HP-ProBook-4520s:/var/www/onlyoffice/documentserver/npm$ sudo netstat -plunt |grep :5672
tcp6 0 0 :::5672 :::* LISTEN 149269/beam.smppeacecop@peacecop-HP-ProBook-4520s:/var/www/onlyoffice/documentserver/npm$ sudo netstat -plunt |grep :6379
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 151482/redis-server
tcp6 0 0 ::1:6379 :::* LISTEN 151482/redis-server
And now, suddenly, port 8000 was occupied as well:
peacecop@peacecop-HP-ProBook-4520s:/var/www/onlyoffice/documentserver/npm$ sudo netstat -plunt |grep :8000
tcp6 0 0 :::8000 :::* LISTEN 146639/docservice
What is the process 146639 exactly:
peacecop@peacecop-HP-ProBook-4520s:/var/www/onlyoffice/documentserver/npm$ sudo ps -aux|grep 146639
ds 146639 0.2 0.8 903976 65416 ? Sl aug 03 0:05 /var/www/onlyoffice/documentserver/server/DocService/docservice
peacecop 153002 0.0 0.0 5200 2320 pts/2 R+ 00:30 0:00 grep --color=auto 146639
It seems that ONLYOFFICE runs without nodejs this time.
Anyway, I copied the DEB-file to the main server machine:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo scp onlyoffice-documentserver_amd64.deb kalmer@192.168.1.65:/home/kalmer/
The authenticity of host '192.168.1.65 (192.168.1.65)' can't be established.
ECDSA key fingerprint is SHA256:uoomcI43mMtknlstYcMSofaJR1u0QjDSGr6W3A618l8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.1.65' (ECDSA) to the list of known hosts.
kalmer@192.168.1.65's password:
onlyoffice-documentserver_amd64.deb 100% 249MB 11.0MB/s 00:22
I also wanted to confirm that I had the latest version 5.6:
peacecop@peacecop-HP-ProBook-4520s:~/Allalaadimised$ sudo apt search onlyoffice
[sudo] password for peacecop:
Sorting... Done
Full Text Search... Done
onlyoffice-documentserver/now 5.6.0-17 amd64 [installed,local]
online viewers and editors for text, spreadsheet and presentation files.
I also gave another shot to the community server. I must tell you that if your time is important for you, forget the community server! Nextcloud is just everything you need for a web file management system and other apps. It took more than an hour to bring up the community server inside docker. During that time the whole laptop with 8 GB RAM was frozen. After that, I could load it in web browser, create an administrator user and start using it. It looked very promising: project management and everything inside! But all that shit doesn’t matter if the system is slow as snail and overloads the computer.
Last bat not least, I tested out the collaboration. For that, I connected the community server to my Nextcloud and opened the same file in both file management systems. During that process, many times one or the other browser tab crashed. I could still do some changes in Nextcloud and see those changes in the community server, however they appeared first after closing and reopening the file, not on the fly as they were supposed to appear.
Then, I opened the same file in Nextcloud in two laptops. I saw my changes in either of them in real time. I could comment and chat. On the same time, community server didn’t show shit. I also tried to log in on the other laptop at the same time and the logging in process kept going without an end.
So if you want to switch from Google Drive to Nextcloud and ONLYOFFICE document server, you would survive some schocking experiences and not the positive way. Whatsoever, Nextcloud and ONLYOFFICE document server are FOSS and this is the only thing that thrives me in this direction.
I would not install the community server to the main server machine with only 4 GB RAM. The community server is like an externally super attractive human of the opposite sex but if I let them close to me they eat me alive. So I rather go out and in with somebody whose body vehicle isn’t that beautiful but who cares of me.
I also want to add this long story that after the last change of the document server in the main server machine, I was very upset as none of the files in Nextcloud had my changes made during the last three days. I only could restore the changes because I still had these files open in one of the laptops. I had to create new files and manually copy and paste the contents of all the worksheets. This means that the databases are still in use for changes. I also want to figure out why are there two databases needed for that.
Until there is no better FOSS document editing collaboration web-based system available, ONLYOFFICE is the best. It’s not good, far from that but it’s the best what we have.
Meanwhile, I had discussions with some developers of ONLYOFFICE and got some answers. There’s an upgrade guide and an API guide.
A new problem is that the ONLYOFFICE isn’t server if RabbitMQ doesn’t work. Sometimes, it just stops working and restarting doesn’t help — it just keeps activating. Once, there were some intruders detected, once the disk filled up. In the first case, RabbitMQ started to work after a day or so. This time, I didn’t dare to wait, purged and reinstalled it and now, it works again. I didn’t notice any data loss. As this happened again after restarting the server machine, I reported this as a bug on 20210115.
This is why I followed the suggestions of ShockwaveNN and turned off all the onlyoffice-stuff in supervisor. Afterwards, in order to get ONLYOFFICE running, I turned them on again by issuing:
kalmer@test:/etc/supervisor/conf.d$ sudo supervisorctl restart all
osrm-car: stopped
osrm-bicycle: stopped
osrm-foot: stopped
osrm-car: started
osrm-bicycle: started
osrm-foot: started
ds:metrics: started
ds:spellchecker: started
ds:example: started
ds:docservice: started
ds:converter: started
He also suggested to report to rabbitmq’s developers which I did.
It turned out that rabbitmq-server can’t connect to the node test because it couldn’t find where test is. This is weird because why it did find it after a reinstall? So what I did was setting test to lead to 127.0.0.1 in hosts. Now, everything works just fine. I did it because of a suggestion at Programmersought. This all happened to and with me on 20210120.
20201019: I discovered that the function SUMIFS didn’t work, so I reported the issue following by upgrading the document server making the function work again.
For version info, I opened another issue.