These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for *.domain.com on the new forum.
I couldn't find on google how can I setup apache to handle these requests (pointing to the same location). Is there a certain place where to set a certain rule or should I get into the apache config files and alter them manually? Thanks.
I dunno. I don't think anyone has ever asked to create a "catchall" subdomain alias, and I've certainly never set one up. ;-)
But, you're obviously not the only person to want to do this, since Apache has syntax for it. According to the Apache docs, you can include wildcards in a ServerAlias directive:
http://httpd.apache.org/docs/2.2/mod/core.html#serveralias
So, add this to the domain.com VirtualHost section:
ServerAlias *.domain.com
And add a similar wildcard record to the BIND zone.
Neither of these things has a named option in the UI in Virtualmin, but if you wanted it to be standard practice for all of your virtual servers, you could just add the necessary line to the Server Template in the Apache and BIND sections. So, still pretty simple, even if it's not a "click a button" kind of thing.<br><br>Post edited by: Joe, at: 2008/06/29 23:43
--
Check out the forum guidelines!
Thanks!
I altered /etc/apache2/sites-available/domain.com.conf
changing
ServerAlias lists.retailcop.ca
to
ServerAlias *.retailcop.ca
Hope it works (I wait for the DNS change to check that)
there is a bug that doesn't let me edit the post :)
<b>Joe wrote:</b>
<div class='quote'>I dunno. I don't think anyone has ever asked to create a "catchall" subdomain alias
</div>
What is so unusual about it? :)
<div class='quote'>
Neither of these things has a named option in the UI in Virtualmin, [...] So, still pretty simple, even if it's not a "click a button" kind of thing.</div>
Why not simply allow *.domain.com when creating alias-(servers)? :)
I came across this post because I made a typo editing my template for *.domains.
I meanwhile corrected that and could not find a more suitable topic here...
My question is:
(How) Can I "force-rewrite" all .conf files for all sites/servers in order to make the new/modified template take effect on all existing sites/servers?
Cheers,
Hans
<div class='quote'>What is so unusual about it? :)</div>
I dunno. Nobodies ever asked for it and I've never done it. That makes it unusual to me.
<div class='quote'>Why not simply allow *.domain.com when creating alias-(servers)? :)</div>
Good question. It wouldn't require any additional options in the UI, which is a total win. We would just allow a *.domain.tld in the name field. I have a loathing for new options, because we already have too many. So, whenever anyone asks for new options, my first instinct is to fight! Unfortunately, Jamie's first instinct is, "That'd be pretty easy to add...there I just checked it in. It'll be in the next release." But on this one, I think we can all be happy. ;-)
I'll ask Jamie to chime in on this thread with his thoughts, just in case I'm missing some obvious flaw in allowing this, without adding anything new to the domain alias form.
As for forcing a rewriting of all configuration files...BIND you can just disable and re-enable name service for the domains. From the command line you can use the "--all-domains" option to do it all at once. But Apache...I don't think you can disable the website for a virtual server, so no way to "re-enable" it with the new template. I'll leave it to Jamie to answer this one as well. It might take a one off script to get the job done.
--
Check out the forum guidelines!
Support for a *.domain.com virtual server shouldn't be that hard to add. There are some complications as normally the admin username and database name is based on the first part of the domain, and a user named * wouldn't work too well. I will add this to my TODO list though..
--
Check out the forum guidelines!
<div class='quote'>There are some complications as normally the admin username and database name is based on the first part of the domain, and a user named * wouldn't work too well.</div>
You're making your life too hard, Jamie. Aliases don't have usernames. I don't think anybody wants a catchall Sub-server. At least, I certainly hope not.
--
Check out the forum guidelines!
Good point - since this is only really useful for alias domains, it becomes a fair bit simpler.
--
Check out the forum guidelines!
@jamie
Cheers! I am looking forward to see that *.domain option in next versions
@joe
Cheers to you as well :) My question was ref. Apache, sorry if I have been unclear. But the idea you gave me helped: I disabled website (and in order to do so I had to also enable logfile-rotation and webalizer), re-activated and the .conf file was re-written.
No problem in my case as I only a couple of domains were affected by my previous typo in the template, but it would be nice if there was an option/button like "re-configure (selected) sites" or "re-write config files w. updated/modified template" somewhere, maybe in the templates section or in below the virtual server list.
Would come handy when s.o. has a large number of domains and wants to mod the template for them all w. one click.
Have agood weekend,
Hans :)
Yeah, being able to re-apply the template is on my TODO list. Although it will be effectively the same as turning off the feature and then turning it back on again ..
--
Check out the forum guidelines!