Background: I have a bit of Perl CGI code that I use to scan a requested web folder and return RSS code for a podcast feed. I had this within a virtual host in Web Station and was working in DSM 7.1 and earlier. But after updating to DSM 7.2 and the associated Web Station update I found that I could only run the CGI script, or any script, when requesting using the default host server name. I've raised a ticket with Synology Support but also decided to dig a bit more.
First, check what the Apache conf files looked like in DSM 7.1: I found that all virtual hosts are contained in
Looking in DSM 7.2 and things have changed. Only the Web Station default host file has the Options directive. The virtual hosts created from Web Portals no longer have any Options. I tried adding the Options line and restarting Web Station, but that overwrote the edit. Doing the edit again and stop/start Apache, great! the Perl CGI is now working. But this is quite temporary.
I then looked to see where the template file is that Web Station uses to generate these virtual hosts files and found a likely canditate here
I've stop/started Web Station and Apache and the regenerated files have the Options directives, and my Perl CGI is working. Definitely needs some more investigating but for now I can wait a while for Support to respond to what I've found out.
First, check what the Apache conf files looked like in DSM 7.1: I found that all virtual hosts are contained in
/usr/local/etc/apache24/sites-enabled
. Comparing the files and I can see they all have Options MultiViews FollowSymLinks ExecCGI
in the <Directory>
block. Yep that's what I expected.Looking in DSM 7.2 and things have changed. Only the Web Station default host file has the Options directive. The virtual hosts created from Web Portals no longer have any Options. I tried adding the Options line and restarting Web Station, but that overwrote the edit. Doing the edit again and stop/start Apache, great! the Perl CGI is now working. But this is quite temporary.
I then looked to see where the template file is that Web Station uses to generate these virtual hosts files and found a likely canditate here
/volume1/@appstore/WebStation/misc/apache24_service_template.mustache
. There are two <VirtualHosts>
blocks and I placed the Options directive inside both of their <Directory>
blocks. There is another file that has the Options directive, VirtualHost-apache24.mustache. There must be some hierarchy of files and what feeds into what. But I can't yet say how this wasn't an issue before and now is one.I've stop/started Web Station and Apache and the regenerated files have the Options directives, and my Perl CGI is working. Definitely needs some more investigating but for now I can wait a while for Support to respond to what I've found out.