未知 的大頭貼

Setting up Nextcloud 16 on Synology Webstation

Webstation configuration

Follow http://andreasschmid.com/2018/12/24/nextcloud-on-synology-nas/ , but I used nginx and PHP 7.2 instead. And of course don’t use the mysql root user for nextcloud.

Configure SSL certificate

Basically follow : https://stefandingemanse.nl/how-to-use-lets-encrypt-ssl-certificate-on-synology-dsm/

But in the “Security > Certificate" settings you need to enable the certificate for Webstation. Do this by selecting the Let’s Encrypt certificate, click Configure, and select to use this cert for your virtual host.

Failed to start session error

It is caused by Webstation has enabled PHP open_basedir restrictions. In the PHP profile you need to configure /var/services/tmp:/dev/urandom:/tmp

I got this from: https://webcache.googleusercontent.com/search?q=cache:A8qy2RWRhUgJ:https://www.synology-forum.de/showthread.html%3F99836-Nextcloud-Problem-mit-PHP-7-2+&cd=3&hl=zh-TW&ct=clnk&gl=tw&client=firefox-b-d

‘SQLSTATE[HY000] [2002] No such file or directory’ on Nextcloud initial config page

Initially for the database host field I entered localhost:3307 and had the error ‘SQLSTATE[HY000] [2002] No such file or directory’ . Following the idea here to change it to 127.0.0.1:3307 gave a success.

`nginx` configs for Nextcloud

In the beginning the login page index.php/login will be 404, because all the rewrite rules are not in place yet.

Take reference from Nextcloud documentation, put configs without the server block into /etc/nginx/conf.d/YOUR_UUID/user.conf like this. YOUR_UUID will be different on each machine.

Also need to put in php-handler setting in /etc/nginx/conf.d/http.php-handler.conf like this. It is actually included from nginx.conf with include conf.d/http.*.conf

Restart nginx: sudo synoservice --restart nginx

Now you should be able to access the login page!