I’ve upgraded my Synology DS 212+ to the latest DSM version 5 few weeks ago.
Many things have changed on this new DSM version, and one of the things that changed, was the way Web station and Apache/PHP works.
The configuration files are different from the previous version 4 and they use now upstart to start and stop the service:
To stop the Web Station: /sbin/initctl stop httpd-user
To start the Web Station: /sbin/initctl start httpd-user
There is also a status command, to show the state of the server: httpd-user stop/waiting (Stopped) or httpd-user start/running, process #### (running)
For FileStation and Audio station, these application/sites normally expect the browser to connect to application ports, namely in my case the port 7000 and 7002. This has potentially two problems: I need to open them up on my home router to allow access, and sometimes I’m behind a proxy that doesn’t allow anything else to be used as a port on the url (except for port 80-HTTP or 443-HTTPS).
So I have these applications behind a reverse proxy on the WebStation. With this configuration I have my “normal” http address: http://primalcortex.somedomain.com and I also have http://filestation.primalcortex.somedomain.com and http://audio.primalcortex.somedomanin.com.
What is needed to achieve this? Well first a a dns server that accepts wirldcard domains. the Myds.me is one of them and is provided by Synology and directly integrated into the DSM.
Second a file like this is needed to be created:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
#For File Station
RedirectPermanent / https://filestation.mydomainname.myds.me/
SSLProtocol all -SSLv2
Allow from all
ProxyPass / http://localhost:7000/
ProxyPassReverse / http://localhost:7000/
(In case something is missing above due to WordPress formating issues see this -> http://pastebin.com/C7WF8kTN)
Save this file as httpd-FILESTATION-vh.conf-user at /usr/syno/etc
Then add the following line at the end of this file /etc/httpd/conf/httpd.conf-user
Repeat for other sites like Audio Station, changing the hostname and the localhost port.
You can now run the following command: /usr/syno/etc/rc.sysv/httpd-user-conf-writer.sh and check if the above include is added to the /etc/httpd/conf/httpd.conf file. This file is always regenerated at start of the Web Station.
Now we can restart the web station with /sbin/initctl stop httpd-user followed by the start command.
Check now if you can access the url: https://filestation.mydomain.myds.com
Edit: This works for version 5.0-4482
For more recent versions you need also to do the following:
Edit file /etc/httpd/conf/extra/httpd-ssl.conf-user and comment out the ServerName and ServerAlias like this
Save the files, write again the configuration (/usr/syno/etc/rc.sysv/httpd-user-conf-writer.sh), stop ( /sbin/initctl stop httpd-user) and start again ( /sbin/initctl start httpd-user), and it should work now.
Thanks for Markus (below at the comments for the solution) and Tensai for corrections.