Synology Nextcloud questions

Nextcloud version: 20.0.4
Operating system and version: DSM 6.2.3
Apache or nginx version: Apache 2.4
PHP version: 7.3

After setting up Nextcloud, there are still some warnings/tips showing up in the settings app.

  • Some app directories are owned by a different user than the web server one. This may be the case if apps have been installed manually. - /volume1/web/nextcloud/apps/etc etc.
  • Your web server is not properly set up to resolve “/.well-known/caldav” and “/.well-known/carddav”.
  • No memory cache has been configured. To enhance performance, please configure a memcache, if available.
  • The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running “occ db:add-missing-indices” those missing indexes could be added manually while the instance keeps running.

I have been running Nextcloud on a Debian VPS for several years, relying on these forums for tips and how-to´s. Unfortunately, I just can´t find information to help me resolve above issues because DSM is not a typical Linux OS where I feel comfortable editing files through SSH.

My questions come down to:

  • What permissions in /volume1/web/nextcloud/apps/ do I need to revoke? I have revoked everything that is not the http user but the warning stays;
  • What file do I need to modify to resolve the “/.well-known/caldav” and “/.well-known/carddav”. errors?
  • My system already has PHP-FPM. How do I ´tell´ Nextcloud that I have caching in place?
  • How do I run occ db:add-missing-indices on my DSM? There is a Task application but no matter what, the warning stays.

Is this the first time you’ve seen this error? (Y/N): No, it happens everytime I set-up Nextcloud on my Synology.

Steps to replicate it:

  1. Download the Nextcloud zip;
  2. Unpack it in a webstation folder;
  3. Go to the Nextcloud instance and log-in to it.

I stumbled across https://blog.viking-studios.net and excelent source of information I somehow could not find. Below I wrote how to resolve above warnings so that others could use this thread to troubleshoot. All credits to Andreas Hoffman from viking studios.

To resolve the no memory cache warning
Edit the config.php file in your nextcloud/config folder. Add the following line of code at the bottom (but before the ); )

‘memcache.local’ => ‘\\OC\\Memcache\\APCu’,

To resolve the HSTS warning
Although you might be using Apache, you need to do these steps for Nginx. Open an SSH connection to the Synology and use the following commands:
sudo -i
cd /etc/nginx/conf.d/
vi http.hsts.conf

and add the following line of code:
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";

quit vi using the ´:´ button followed by escape and ´qw´

Now type one last command
synoservice -restart nginx

The HSTS warning is gone.

Missing indices warning
First, make sure http is the owner of the /nextcloud/ folder. Do this by typing the following commands in you SSH terminal:
chown -R http:http /volume1/web/nextcloud/
chmod -R 777 /volume1/web/nextcloud/

Now, type the following command. Note: use the php version u are using for Nextcloud, i use 7.4.
sudo -u http php74 -d memory_limit=1024M occ db:add-missing-indices

The indices warning is gone.

1 Like

Everything must be owned by the user context of the web server. The same as your web root.