Linking just the tutorial isn't enough information, the better is if you post your configuration file.
The thing you end up in
/var/www when opening your virtualhost address can have more causes.
Apache configuration file is built the way that without context, the directives are applied globally. Otherwise they apply only within the context. The virtualhosts are done the way the
* virtualhost is set as default. If there is none such, the first virtualhost encountered while parsing the config is taken as default.
Now, finally, to the possible answer:
1) In your virtualhost you have not set the DocumentRoot directive and the (presumably default) global DocumentRoot is pointing to the
2) Your virtualhost is not working in the way you expect. This sometimes happens when you make a mistake in naming. With
LogLevel debug enable the debug logging and watch what happens and which virtual host is called when you open the desired address.
The log files on Debian are located in (not 100% sure)
Post your config files and debug messages, you greatly increase the chance of useful suggestions.
Well it seems you turned on name-based virtual hosting. Basically your config looks reasonable. In the
<VirtualHost ...> clause, you should specify the destination port like
<VirtualHost *:443> and so.
ServerName are here, it is ok. Probably your virtual host doesn't get invoked when you request the page.
This can be because the Apache doesn't know, what IP the
sub.domain.com points to. Do you have
sub.domian.com in DNS or, at least, in hosts file?
More on name-based virtual hosts: http://httpd.apache.org/docs/2.2/vhosts/name-based.html