I've been playing around with virtual hosting for a little while, and have got it working - to a point. Perhaps i misunderstand what Virtual Hosting is, so let me explain what I want to do, and can someone tell me if this is possible with Virtual Hosting, or am I just wasting my time .. :-)
I bought a domain a while back (
www.mydomain.net), had it hosted at a well known uk-based hosting service. I also had several subdomains set up at that domain.
I've figured out that I can now host my own domain from my linux box, which works a treat, but now i'd like to have access to my sub-domains too.
So i've setup my
httpd.conf file (snipped to protect the innocent),
<VirtualHost *:80>
ServerName www.mydomain.net
ServerAlias mydomain.net *.mydomain.net
DocumentRoot /var/www/html/mydomain
ServerSignature email
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>
<VirtualHost *:80>
ServerName www.mysubdomain.net
ServerAlias mysubdomain.net *.mysubdomain.net
DocumentRoot /var/www/html/mysubdomain
ServerSignature email
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>
I also edited my
etc/hosts file, because it suggested somewhere else on this forum and it seemed to make things work so ...
Anyway, I can see my Virtual Server from my machine (i use name based Virtual hosting) but when i type in
http://www.mysubdomain.net all I see is the original
www.mydomain.net
I know that the
httpd.conf file determines which is the main server (based on the order it appears in that file) but how do i get access from the internet to my Virutal Subdomain?
I've tried everything, and i cant get it to do what i *think* it should do. Is this what virtual hosting allows you to do? Or is it only for intranets?
thanks
/* Sjg */