Connect Synology Diskstation with Ubuntu Server

Here is a small manual for setting up a connection between an Ubuntu server and a Synology Diskstation. Prerequesites are that you created a shared folder and configured your Diskstation successfully. After that you can start sharing that content to your Ubuntu server.

  1. Open the Diskstation Web Application
  2. Go to “Control Panel – Shared Folder”
  3. Open “NFS-Access”
  4. Create a new one
    Client: *
    Privilegde: Read/Write
    Root squash: default
    Asynchronous: Yes
  5. Write down the mount path from the bottom of this pop-up, in my case it was “/volume1/Backup”
  6. Open a shell on your Ubuntu server
    sudo apt-get install nfs-common
    sudo mkdir /mnt/diskstation
    sudo mkdir /mnt/backup
    sudo mount -t nfs 192.168.0.X:/volume1/Backup /mnt/backup
  7. Congratulations! You just added a Synology Diskstation to your Ubuntu server.

What now? Perhaps you want to sync your data (like I did):

rsync -rvz /mnt/diskstation /mnt/backup
-r ... include subdirectories
-v ... verbose mode, display output
-z ... compress content for lesser network traffic

Update

I added a new menu entry: University. There you can perhaps find some useful helpers and information for your studies.

Free HTTPS Certificate from Let’s Encrypt

If you want to secure the connection of your server with a valid and free certificate – that also modern browser will recognise – you should go to this website and follow the instructions there. Currently big companies like Akamai, Cisco, Mozilla and Facebook are supporting Let’s Encrypt so I guess there is no argument not encrypting the communication to your server. Additional this tool configures your existing Apache server so that your HTTPS connection is set up in less than 5 minutes.

Here is the link: https://letsencrypt.readthedocs.org

After that you can test your website on security issues: https://www.ssllabs.com/ssltest/analyze.html

Hint: non www to www
Now if you have a certificate for your www.domain.com and you want to redirect domain.com to www.domain.com you have to add the following commands to your default-ssl.conf located in /etc/apache2/sites-available directory:

<VirtualHost *:443>
...
RewriteEngine on
#RewriteCond %{HTTP_HOST} !^localservername -->used for local access
RewriteCond %{HTTP_HOST} !^www\. -->check if www is missing
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}$1 [R=301,L] -->add www.
</VirtualHost>

Your default.conf located in /etc/apache2/sites-available should be modified as shown below:

<VirtualHost *:80>
	...
	# redirect all http queries to https
	Redirect permanent / https://www.domain.com 
</VirtualHost>
or
<VirtualHost *:80>
  RewriteEngine On
  RewriteCond %{SERVER_PORT} ^80$
  RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
</VirtualHost>

Raspbian Upgrade Wheezy to Jessie

I upgraded my current version of Raspbian Wheezy to Raspbian Jessie. If you want to upgrade your Raspberry Pi too than follow these steps:

/etc/apt/sources.list
...
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
...

After that upgrade and restart your device:

>> apt-get update && sudo apt-get dist-upgrade
>> reboot