PDA

View Full Version : adding subdomain to vhost with ServerAlias



peach
06-07-2009, 03:06 AM
Hi,

I'm trying to add a subdomain to my site, and from what I've read here on the forums this can be done through the vhost template from an existing domain name.

I know there is also a subdomain tool in DirectAdmin but this is not what I need, because the documentroot of both domain and subdomain are the same (its a multisite script).

So I have added a server alias to the bottom of the httpd template textarea of my domain name like this:
ServerAlias demo.example.com

And in the grouped httpd.conf textarea below the custom textarea I can see there are now 2 serveraliases appearing:

ServerAlias demo. example.com


ServerName www. example.com
ServerAlias www. example.com sooperthemes.com
ServerAdmin webmaster@ example.com
DocumentRoot /home/projects/clearwind-group
ScriptAlias /cgi-bin/ /home/projects/clearwind-group/cgi-bin/

But the subdomain does not work. Does the server require additional setup? Or does it just ignore the first ServerAlias and ignore the second?

Who has experience with this? :)

tillo
06-07-2009, 03:09 AM
You could use the inbuild subdomain tool of DirectAdmin then remove the subdomain directory and create a "subdir -> ." symlink.

peach
06-07-2009, 07:52 AM
You could use the inbuild subdomain tool of DirectAdmin then remove the subdomain directory and create a "subdir -> ." symlink.

I guess, but Im worried that the subdomain tool does some more things besides creating a directory that Im not aware of, adding overhead to my system.

tillo
06-07-2009, 09:16 AM
Nope. It creates a DNS entry, a VirtualHost, a directory and an internal record to keep track of the subdomain. Nothing more.

peach
06-07-2009, 10:15 AM
Nope. It creates a DNS entry, a VirtualHost, a directory and an internal record to keep track of the subdomain. Nothing more.

ah, maybe the DNS entry was also what was missing from my own setup. Where can you manage/change that?


Thx for the info so far!

nobaloney
06-07-2009, 01:23 PM
If you have DNS Administration available from your login, then you can use it to add A records for subdomains, though you cannot add new zones.

If you don't have DNS Administration available, then you need to contact your hosting provider.

Jeff

peach
06-08-2009, 01:11 AM
I own the server and have admin login so that should be ok, permission wise.

peach
06-08-2009, 01:39 AM
OK I added that A record and now it's working, Thx a lot Jeff!