Installing on Synology DSM

Requirements

  • A Synology NAS with an Intel processor. If you successfully install on an unit with a different processor architecture, please let us know.
  • Some familiarity of the Synology DSM control panel.
  • Basic understanding of terminal and SSH usage.
  • Knowing how to do minor text editing with nano or vi.
  • Admin access to the DSM control panel.
  • Root SSH access.

Synology help for SSH

Know your NAS address

You may have configured external access through the synology.me dynamic DNS service or some other service. Perhaps your server is only available in the local network. In any case, you'll need to have the IP address or domain where your NAS is reachable.

The Synology web assistant may be useful to determine the IP address of your NAS in the local network.

Install ipkg

IPKG is a package manager similar to APT or yum. It will allow you to install some dependencies like ghostscript and imagemagick easily. Have your SSH connection ready, you'll need it here.

ipkg list 

You should see a list of available packages. If you get a not found error, go back to the previous steps and make sure there were no errors.

Install ipkg package

Run in the terminal:

ipkg install ghostscript
ipkg install imagemagick
ipkg install xpdf

xpdf will provide pdftotext

Enable WebStation

  • Follow this guide to enable WebStation (Apache server).
  • Create a virtualhost for ResourceSpace in a directory named resourcespace, as detailed in the same guide.

Install MariaDB

The latest versions of DSM have MariaDB instead of MySQL. MariaDB is a drop-in, fully open source replacement for MySQL.

  • In the DSM control panel, open the Package Center, look for MariaDB and click Install.
  • Once installed, open MariaDB and change the root password.

Install exiftool

wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-9.99.tar.gz
  • Extract the contents of the package
tar zxvf Image-Exiftool*
cd Image-ExifTool*
  • Copy the exiftool executable to /usr/syno/bin/exiftool
mkdir /usr/syno/bin/exiftool
cp exiftool /usr/syno/bin/exiftool
cp -r lib /usr/syno/bin/exiftool

Adding the exiftool directory to PATH isn't necessary because the full path is configured in ResourceSpace.

Adjust php.ini

vi /etc/php/php.ini

In that file, set:

memory_limit = 256M
post_max_size = 100M
upload_max_filesize = 100M

You might need higher values if your users are going to upload video or huge images to the repository.

Fix PHP's open_basepath

  • In the Control Panel, go to Web Services and click on the PHP Settings tab.
  • Check the Customize PHP open_basedir checkbox.
  • In the open_basedir text field enter:
/etc.defaults:/etc:/usr/syno/synoman:/tmp:/var/services/tmp:/var/services/web:/var/services/homes:/opt/bin:/usr/bin:/usr/syno/bin:/var/log:/volume1/web/resourcespace

(this assumes that you named the ResourceSpace virtual host directory resourcespace and that it is located on volume 1)

Install ResourceSpace

Assuming that you named the ResourceSpace virtual host directory resourcespace and that it is located on volume 1:

cd /volume1/web/resourcespace
  • Get the ResourceSpace download URL from here and extract the files.
  • Point your browser to http://[YOUR NAS ADDRESS]/resourcespace and follow the install instructions.

The binary paths are:

$imagemagick_path = '/opt/bin';
$ghostscript_path = '/opt/bin';
$exiftool_path = '/usr/syno/bin/exiftool';
$pdftotext_path = '/opt/bin';

Set up the cron job

  • Open the Control Panel and click on the Task Scheduler.
  • Click on Create and select User defined script.
  • Name the task ResourceSpace.
  • In the User-defined script textarea, enter:
wget -q -r http://[YOUR NAS ADDRESS]/resourcespace/pages/tools/cron_copy_hitcount.php

(assuming that the virtual host you set up is named resourcespace)

  • If you need to change the default daily execution frequency, visit the schedule tab.

Secure your NAS!

You'll have terabytes of valuable assets stored in it, securing them is worth a few extra steps.

  • Disable SSH

It's best to disable services you aren't using, as they might open security vulnerabilities. Go to the DSM control panel and disable SSH (and any other services you aren't using). Yes, there have been attacks over SSH before that ended up in lots of Synology servers compromised and turned into Bitcoin miners (with Atom processors, go figure).

  • Fix permissions. In the terminal, run:
cd /volume1/web/resourcespace
chown http:http *
chmod -R 755 *

(Note the capital R, which means recursive)