Synology DS215jにNextcloudをインストールする方法。

PHPの設定

  • Synology NASのDSMのアプリ 「Web Station」を開き、以下の機能を有効にします。 curl gd iconv mysql openssl pdo_mysql pdo_sqlite zip

  • Next tab: “Core“. Search for the following values and change them accordingly:

memory_limit= 512M upload_max_filesize= 128M (Allows uploading of maximum file size. If you need to upload bigger files, you can set 4000M = 4GB) post_max_size= 128M opcache.enable= 1 opcache.enable_cli= 1 opcache.interned_strings_buffer= 64 opcache.max_accelerated_files= 32531 opcache.memory_consumption= 512 opcache.save_comments= 1 opcache.revalidate_freq= 240

SSHで設定する

$ ssh [user]@192.168.x.x -p[port]
$ sudo -i
# mkdir /volume2/web/nextcloud/
# cd /volume2/web/nextcloud/
# curl -O https://download.nextcloud.com/server/releases/nextcloud-21.0.0.zip

解凍

# chown -R http:http /volume2/web/nextcloud/
# chmod -R 0770 /volume2/web/nextcloud/

# cd /volume2/web/nextcloud/
# curl -O https://download.nextcloud.com/server/installer/setup-nextcloud.php
  1. Open the file /etc/nginx/proxy.conf in PuTTY (as root).
  2. Add the entry proxy_read_timeout 600; at the end.
  3. Save and close the file.
  4. Test the configuration with nginx -t.
  5. Restart the nginx with synoservice -restart nginx.
  6. Create the file /usr/local/etc/apache24/sites-enabled/apache_nextcloud.conf with PuTTy and inserts the following lines: ProxyTimeout 600 Timeout 600
RequestReadTimeout body=0
  1. Save and close the file and restart Apache, which is cumbersome by starting and stopping the Web Station, restarting DiskStation or you create a scheduled task: Task Scheduler > Service > Start / Stop task for Apache. Deactivate the tasks and manually executes the stop task first, wait a moment and then execute the start task.

vi nextcloud/lib/private/Setup/MySQL.php Open (with PuTTY) the file /volumeX/web/Nextcloud/lib/private/Setup/MySQL.php Scrollt almost to the end an look for following line:

$this->dbPassword = $this->random->generate(30, ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER);

Remove “, ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER“, so it looks like this:

$this->dbPassword = $this->random->generate(30);

Save and close the file.

/etc/nginx/nginx.conf keepalive_timeout 605s 20s;

http://192.168.0.5/nextcloud/setup-nextcloud.php In the field asking where Nextcloud should be installed, delete nextcloud and replace it with a single dot:

By default, Nextcloud is configured to use SQLite, but that can cause all kinds of performance issues, so change this option to MySQL/MariaDB and fill in the details as follows:

Username: root
Password: The password you set when you installed MariaDB earlier
Database name: This can be anything you like, let’s go with nextcloud
Delete localhost and replace it with 127.0.0.1:3307

At this point you MIGHT get a 504 error. Don’t worry, Nextcloud has installed. This is just a weird bug in Nextcloud. Leave it for 5 minutes and refresh the page; you should then see the Nextcloud login page.