Update
Since DSM 5 the paths are changed:
DSM 4:
- /usr/syno/etc/httpd-ssl-vhost.conf-user
- /usr/syno/apache/conf/httpd.conf-user
DSM 5:
- /etc/httpd/sites-enabled-user/httpd-ssl-vhost.conf-user
- /etc/httpd/conf/httpd.conf-user
I’m an owner of a Synology DS211 and i have installed Sabnzbd+ on it, using this helpful package http://synoblog.superzebulon.org/2011/09/sabnzbd-0-6-9-1-spk/ (add it to your favorites, it’s a really nice site with more packages to download).
My Synology is running on the latest 3.2 firmware.
After installation Sabnzbd+ is running on the following address http://private-diskstation-ip:8080, and i wanted to make it accessible in a secure way from the internet.
I want to be able to access the sabnzbd+ instance only from https and with a user/password prompt.
This could be done by configuring Apache. In fact i want to run sabnzbd+ behind Apache on Synology.
After a evening of searching and probing i finally got it working as I wanted:
The first thing to do if you haven’t already did it is to enable access to the Synology from the Command Line (http://forum.synology.com/wiki/index.php/Enabling_the_Command_Line_Interface)
Then from the prompt we edit the Apache configuration file with vi
(here are the basic commands: http://forum.synology.com/wiki/index.php/Basic_commands_for_the_Linux_vi_Editor):
For DSM 4:
vi /usr/syno/apache/conf/httpd.conf-user
For DSM 5:
vi /etc/httpd/conf/httpd.conf-user
We have to add the following directives at the end of the file:
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so
Then we modify the virtual host file (i want to access Sabnzbd+ from a sub domain url, like subdomain.domain.com)
For DSM 4:
vi /usr/syno/etc/httpd-ssl-vhost.conf-user
For DSM 5:
vi /etc/httpd/sites-enabled-user/httpd-ssl-vhost.conf-user
And I added the following text:
ServerName subdomain.domain.com <Location "/"> ProxyPass http://localhost:8080/sabnzbd/ ProxyPassReverse http://localhost:8080/sabnzbd/ AuthType Basic AuthName "Restricted Files" AuthUserFile /volume1/web/passwd/users.pw Require valid-user </Location> SSLEngine on
Note that i already have created an authentication file (users.pw) which i’m using also for other protected host, if you don’t know how to create it follow this http://www.synology.com/support/faq_show.php?q_id=347&lang=enu
Then restart apache:
For DSM 4:
/usr/syno/etc/rc.d/S97apache-user.sh restart
For DSM 5:
httpd -k restart
Ready! Now i’m able to reach Sabnzbd+ running on my Synology from subdomain.domain.com in https and with user/pass prompt.
After doing that, be careful about editing vhosts with the Synology Gui, because modifying them from there will overwrite our custom modifications we have done in the /usr/syno/etc/httpd-ssl-vhost.conf-user file.
Don’t forget to open port TCP 443 on your router/modem and forward it to the internal ip of your Synology, and to create the subdomain in your DNS server/hosting provider.
Thanks for this really useful post.
Sorry to bring you back to it after so long but..
Could this be used to access multiple services on a syno?
I use dyndns so i can access my ip address at username.dyndns.org.
I then use the virtual server settings on my adsl router to forward various ports to the ports on my syno (username.dyndns.org:9200 for sab, username.dyndns.org:9300 for couchpotato etc)
would it be possible to use the reverse proxy so that i connect to username.dyndns.org/sab
username.dyndns.org/couch
etc
and the requests are forwarded to the internal port.
This would make it easier to access (names instead of port numbers) and i could also close off the multiple ports and just connect through a single port.
LikeLike
yes, this can be done.
You can use a subdomain like yourservice.dyndns.org, or with a subdir like username.dyndns.org/yourservice.
If you choose for a subdir then you have to change the vhost config like (you have to modify the location and remove the / at the end of the proxypass lines)
For service like couchpotato you have also to modify some settings for the program, take a look at:
http://lime-technology.com/forum/index.php?topic=15913.0
LikeLike
Thanks for the quick response
hopefully that will do what i need it to.
LikeLike
Thanks for the quick response
hopefully that will do what i need it to.
LikeLike