adding subdomain to vhost with ServerAlias

peach

Verified User
Joined
Feb 15, 2009
Messages
19
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? :)
 
You could use the inbuild subdomain tool of DirectAdmin then remove the subdomain directory and create a "subdir -> ." symlink.
 
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.
 
Nope. It creates a DNS entry, a VirtualHost, a directory and an internal record to keep track of the subdomain. Nothing more.
 
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!
 
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
 
I own the server and have admin login so that should be ok, permission wise.
 
OK I added that A record and now it's working, Thx a lot Jeff!
 
Back
Top