Knowledgebase
Wildcard DNS and Subdomains on VPS
Posted by ashras99, 12-23-2009, 11:31 AM | I am trying to Setting up Wildcard DNS & Subdomains on cPanel.
I added the following entry in WHM -> Edit DNS Zone
* 14400 IN A IP
Now inside httpd.conf file i changed the ServerAlias www.yourdomain.com
to
ServerAlias *.yourdomain.com www.yourdomain.com
Now if i access the abc.yourdomain.com then open the homepage. (abc subdomain doesnt exist)
But if i access the forum.yourdomain.com then again open the homepage. (forum subdomain already exists created through cpanel).
Please tell me how i can enable the wildcard DNS suddomain and also access the previously created subdomains properly without affecting anything.
|
Posted by webleadGM, 12-23-2009, 01:42 PM | Is your forum apache virtualhost goes after wildcard one? If so just put it BEFORE wildcard. Hope this helps.
|
Posted by madaboutlinux, 12-23-2009, 02:08 PM | Well, it looks quite tricky... Try using a dedicated IPs for the sub-domains you have previously created.
|
Posted by ashras99, 12-23-2009, 02:15 PM | Adding forum entry before wildcard will help because we are adding a wildcard to whole site *.mydomain.com
I have 6-7 subdomains.. so can't allot so many dedicated IP's to every subdomain.
|
Posted by webleadGM, 12-23-2009, 02:17 PM | Please explain first line
|
Posted by Vinayak_Sharma, 12-23-2009, 02:37 PM | Take a hint from
http://ma.tt/2003/10/wildcard-dns-and-sub-domains/
&
http://trac.mu.wordpress.org/browser/trunk/README.txt
You must have a mechanism for Apache to understand the request and serve accordingly.
|
Posted by ashras99, 12-23-2009, 02:54 PM | Thanks guys, moving active subdomains on top helped.
Just tell me what's the difference in these 3 lines and which one is better.
ServerAlias *.yourdomain.com www.yourdomain.com
ServerAlias *.yourdomain.com
ServerAlias *.yourdomain.com yourdomain.com
|
Posted by webleadGM, 12-23-2009, 02:56 PM | ServerName is indicating your main domain address and ServerAlias indicating all other possible URL's to access this certain domain.
So in your case
ServerAlias *.yourdomain.com
will do the trick if your ServerName is yourdomain.com
|
|
Add to Favourites
Print this Article |
Also Read