Note: For purposes of this article, Ubuntu server 22.04.3 LTS has NextCloud installed and hosted on Apache2 web server on standard TCP ports 80 and SSL port 443, and has OnlyOffice Server hosted on Nginx web server which is listening on non-standard port 81 and proxied to the internet through Apache2 server on the same box from standard TCP ports 80 and SSL TCP port 443. NextCloud Admin configures ONLYOFFICE Connector which is a NextCloud plugin-app connecting NextCloud to OnlyOffice for purposes of adding the functionality to view and edit Office files in the NextCloud web interface.
During and after the Upgrade that was run from a command line during SSH remote session to the Ubuntu server, the upgrade results echoed that something was missing. Notice that, during the ubuntu upgrade of onlyoffice server, there was a warning that under /documentserver-example/ the default.json file had been deleted. The upgrade script prompted whether to keep my currently-installed version – select N (default) – or to install the package maintainer's version – Select Y. And, Y was chosen, which is probably why the Nginx server wouldn't start after the Upgrade, and why OnlyOffice Server was offline and unavailable to NextCloud server.
The same happened for production-linux.json (YES), production-windows.json (YES), etc. So, it would seem that all of this that was added needs to be removed again.
I suspected this had something to do with my previously having removed the OnlyOffice “Document Server Example” that was accessible and ran from the OnlyOffice Welcome page (that confirmed OnlyOffice was working). The OnlyOffice DS-Example was enabled by default upon initial installation and it left the OnlyOffice Server wide open to anyone worldwide to freely utilize the server's bandwidth and to test the OnlyOffice server by creating and editing documents. Plus, it was a security risk.
Following is part of the Upgrade in this regard:
user@svr:~$sudo apt update #To get updated packages from the repositories * * * (results omitted) * * * user@svr:~$sudo apt upgrade #To install the updated packages * * * (results omitted until the next line) * * * Setting up onlyoffice-documentserver (8.1.1-26) ... Configuration file '/etc/onlyoffice/documentserver-example/default.json' ==> Deleted (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** default.json (Y/I/N/O/D/Z) [default=N] ? Y Installing new version of config file /etc/onlyoffice/documentserver-example/default.json ... Configuration file '/etc/onlyoffice/documentserver-example/production-linux.json' ==> Deleted (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** production-linux.json (Y/I/N/O/D/Z) [default=N] ? Y Installing new version of config file /etc/onlyoffice/documentserver-example/production-linux.json ... Configuration file '/etc/onlyoffice/documentserver-example/production-windows.json' ==> Deleted (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** production-windows.json (Y/I/N/O/D/Z) [default=N] ? Y Installing new version of config file /etc/onlyoffice/documentserver-example/production-windows.json ... Installing new version of config file /etc/onlyoffice/documentserver/default.json ... Installing new version of config file /etc/onlyoffice/documentserver/development-linux.json ... Installing new version of config file /etc/onlyoffice/documentserver/development-mac.json ... Installing new version of config file /etc/onlyoffice/documentserver/development-windows.json ... Installing new version of config file /etc/onlyoffice/documentserver/logrotate/ds.conf ... Installing new version of config file /etc/onlyoffice/documentserver/nginx/ds-ssl.conf.tmpl ... Installing new version of config file /etc/onlyoffice/documentserver/nginx/includes/ds-common.conf ... Installing new version of config file /etc/onlyoffice/documentserver/nginx/includes/ds-docservice.conf ... Generating WOPI private key...Done Generating WOPI public key...Done Generating AllFonts.js, please wait...Done Generating presentation themes, please wait...Done Generating js caches, please wait...Done Installing plugins, please wait...Done dpkg: error processing package onlyoffice-documentserver (--configure): installed onlyoffice-documentserver package post-installation script subprocess returned error exit status 1
Next (below) Checking the Status of Nginx, and Checking all the folders and files that might have been added by the upgrade.
~$ systemctl status nginx × nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2024-07-27 20:23:25 UTC; 17h ago Docs: man:nginx(8) Process: 739 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE) CPU: 34ms Jul 27 20:23:17 svr systemd[1]: Starting A high performance web server and a reverse proxy server... Jul 27 20:23:25 svr nginx[739]: nginx: [emerg] open() "/etc/nginx/includes/ds-example.conf" failed (2: No such file or > Jul 27 20:23:25 svr nginx[739]: nginx: configuration file /etc/nginx/nginx.conf test failed Jul 27 20:23:25 svr systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE Jul 27 20:23:25 svr systemd[1]: nginx.service: Failed with result 'exit-code'. Jul 27 20:23:25 svr systemd[1]: Failed to start A high performance web server and a reverse proxy server. lines 1-13/13 (END) user@svr:~$ vim /etc/nginx/sites-available/default user@svr:~$ vim /etc/nginx/sites-enabled/default user@svr:~$ user@svr:~$ cd /etc/nginx/includes/ user@svr:/etc/nginx/includes$ ls ds-common.conf ds-docservice.conf ds-example.conf ds-letsencrypt.conf ds-mime.types.conf http-common.conf user@svr:/etc/nginx/includes$ vim ds-example.conf user@svr:/etc/nginx/includes$ user@svr:/etc/nginx/includes$ cd user@svr:~$ systemctl start nginx ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to start 'nginx.service'. Authenticating as: user (user) Password: ==== AUTHENTICATION COMPLETE === Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details. user@svr:~$ systemctl status nginx × nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sun 2024-07-28 14:29:53 UTC; 1min 4s ago Docs: man:nginx(8) Process: 68920 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE) CPU: 17ms Jul 28 14:29:53 svr systemd[1]: Starting A high performance web server and a reverse proxy server... Jul 28 14:29:53 svr nginx[68920]: nginx: [emerg] open() "/etc/nginx/includes/ds-example.conf" failed (2: No such file o> Jul 28 14:29:53 svr nginx[68920]: nginx: configuration file /etc/nginx/nginx.conf test failed Jul 28 14:29:53 svr systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE Jul 28 14:29:53 svr systemd[1]: nginx.service: Failed with result 'exit-code'. Jul 28 14:29:53 svr systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Again, here is the fix:
sudo rm -rf /etc/onlyoffice/documentserver-example/ #Removes the whole unnecessary "example" sudo rm /etc/nginx/includes/ds-example.conf #This will delete the link that stops Nginx from starting with error sudo service nginx restart #Should restart without problem
Here are the results:
user@svr:/etc/onlyoffice/documentserver-example$ ls default.json local.json nginx production-linux.json production-windows.json user@svr:/etc/onlyoffice/documentserver-example$ rm -rf /etc/onlyoffice/documentserver-example/ rm: cannot remove '/etc/onlyoffice/documentserver-example/production-windows.json': Permission denied rm: cannot remove '/etc/onlyoffice/documentserver-example/nginx/includes': Permission denied rm: cannot remove '/etc/onlyoffice/documentserver-example/production-linux.json': Permission denied rm: cannot remove '/etc/onlyoffice/documentserver-example/local.json': Permission denied rm: cannot remove '/etc/onlyoffice/documentserver-example/default.json': Permission denied user@svr:/etc/onlyoffice/documentserver-example$ sudo rm -rf /etc/onlyoffice/documentserver-example/ [sudo] password for user: user@svr:/etc/onlyoffice/documentserver-example$ ls user@svr:/etc/onlyoffice/documentserver-example$ sudo rm /etc/nginx/includes/ds-example.conf user@svr:/etc/onlyoffice/documentserver-example$ ls user@svr:/etc/onlyoffice/documentserver-example$ cd /etc/nginx/includes/ user@svr:/etc/nginx/includes$ ls ds-common.conf ds-docservice.conf ds-letsencrypt.conf ds-mime.types.conf http-common.conf user@svr:/etc/nginx/includes$ cd user@svr:~$ service nginx restart ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to restart 'nginx.service'. Authenticating as: user (user) Password: ==== AUTHENTICATION COMPLETE === user@svr:~$ sudo service supervisord restart Failed to restart supervisord.service: Unit supervisord.service not found. user@svr:~$ sudo supervisorctl restart docservice docservice: ERROR (no such process) docservice: ERROR (no such process) user@svr:~$ systemctl status nginx ● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2024-07-28 17:35:29 UTC; 2min 49s ago Docs: man:nginx(8) Process: 79725 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Process: 79726 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Main PID: 79727 (nginx) Tasks: 5 (limit: 38337) Memory: 13.7M CPU: 77ms CGroup: /system.slice/nginx.service ├─79727 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;" ├─79728 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""> ├─79729 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""> ├─79730 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""> └─79731 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""> Jul 28 17:35:28 svr systemd[1]: Starting A high performance web server and a reverse proxy server... Jul 28 17:35:29 svr systemd[1]: Started A high performance web server and a reverse proxy server.