This is an old revision of the document!
How to Remove DocumentServer Example Service from OnlyOffice Document Server Installation
See: https://github.com/ONLYOFFICE/DocumentServer/issues/888
Thank you CSchmidtDD Christof T. https://github.com/CSchmidtDD
InstallConfig's Note: ds:example service is NOT disabled by default, at least not in my installation on Ubuntu using the community-edition, and, apparently it is also NOT disabled when using the enterprise-edition installation guide.
CSchmidtDD's Comments: And even if it were disabled, it messes up with the nginx config by having the link to the ds-example.conf in there. The welcome page is messed up by default that way and should not be showing an “example” index.html, at least not for an “enterprise-edition.”
If you installed the Document Server (any edition) and have the same problem - that being, the welcome page was the example index.html, then open a terminal or ssh remotely into your ubuntu or debian server and take the following steps offered by CSchmittDD to get rid of the example:
rm -rf /etc/onlyoffice/documentserver-example/ #Removes the whole unnessecary "example" rm /etc/nginx/includes/ds-example.conf #This will delete the link that stops nginx from starting with error like you mentioned service nginx restart #Should restart without problem service supervisord restart #As Example-Service is gone, it will re-register to only four active packets supervisorctl restart docservice #Restart docservice and now you can see the green checkmark
After these steps, the OnlyOffice-Server should now show you a green checkmark on the welcome page that everything is running correctly.
Hope this fixes your problem(s).
After Running Upgrade for Ubuntu, including OnlyOffice Server, the Nginx service would not start
During and after the Upgrade, it 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 that needs to be removed again.
I suspected this had something to do with my previously having removed the OnlyOffice Server “Example” that ran from the OnlyOffice Test Confirmation Page. The OnlyOffice Server Example was enabled by default upon initial installation and it left the OnlyOffice Server wide open to anyone worldwide to freely utilize bandwidth and test the server by creating and editing documents. Plus, it was a security risk.
Following is part of the Upgrade in this regard:
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
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.