Apache mustache?

Questions about HTTP Access/Mods may go here
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:


2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
I'm New!
I'm New!
Posts: 2
Joined: Wed Dec 07, 2016 5:00 pm

Apache mustache?

Postby pitylee » Wed Dec 07, 2016 5:04 pm

Hello there,

So I have a major problem. I use the 115j for development, and I have found a while ago a workaround for wildcard domain.
I managed to change the apache mustache file in order to add ServerAlias *.domain.com, which have been truncated after the latest update.
So here I am after searching for the httpd vconf "mustache" template file but after an hour I found that I am unable to locate it.

Does anybody know where on the new DSM 6 beta (OR even a prev release) is that bloody file located?

Also, any tips on fastening this piece of iron?

I'm New!
I'm New!
Posts: 2
Joined: Wed Dec 07, 2016 5:00 pm

Re: Apache mustache?

Postby pitylee » Wed Dec 07, 2016 7:37 pm

NVM I found it here: https://forum.synology.com/enu/viewtopi ... 4&t=116164

The default file is found here: /volume1/@appstore/WebStation/misc/*.mustache

We have various mustaches there, to change the default vhost entries through ssh type:

Code: Select all

sudo vi /volume1/@appstore/WebStation/misc/VirtualHost-apache22.mustache

And type

Code: Select all

ServerAlias *.{{fqdn}}
ServerName {{fqdn}}
... And so on for every file.

You go edit and save a vhost on DSM page, after that you can check if it worked:

Code: Select all

sudo vi /usr/local/etc/apache22/sites-enabled/httpd-vhost.conf

Note that this way you will have a wildcard domain name, meaning that all the subdomains will point to web/firme or whatever your docroot is.

Here's one way to set up subdomains with .htaccess:

Code: Select all

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} !^(test|test2).example.com$
RewriteRule ^(.*)$ /_homepage/$1 [L]

RewriteCond %{HTTP_HOST} ^test2.example.com$ [NC]
RewriteRule ^((?!test2).*)$ /test2/$1 [NC,L]

Resolved, yet the other question unanswered, slow apache on DS115J. Any tips, questions and suggestions are welcome.

Return to “HTTP/Apache Mods”

Who is online

Users browsing this forum: No registered users and 2 guests