For one, I dont think sub domains are able to start with
www. If your domain is 'www.mydomain.com' then your sub domains would be 'http://subdomain.mydomain.com'.
In my opinion, a virtual host is simply a section of space allocated to hold a website. For example.
In your home machine, your main website (
www.youdomain.com) would maybe point to the root of your server (/usr/pkg/apache/htdocs/).
If someone was to request the subdomain (
http://subdomain.yourdomain.com) it may point to a subfolder within your route, i.e, /usr/pkg/apache/htdocs/subdomain/
I hope this helps.
Please feel free to correct me if I'm wrong. but this is what I think they are from my experience in webdesign.
As for setting up a sub domain, I dont have a clue, I've only been using linux for a week