I have added record cname store.example.com to domain example.com. After that store.example.com shows info webserver is functioning normally. What should I do to show content of main domain?
I don't know, maybe that is an option. I almost never use cnames either. So maybe a virtual host customisation is possible indeed.
Another way is to create a real subdomain store.example.com and then put in an automatic 301 redirect to example.com. Then you don't need any customisations.