Recently i purchased a vps and want to use it as cdn. I wanted to point sub-domains such as cdn.website1.com cdn.website2.com cdn.website3.com to my vps dedicated ip and create folders such as /var/www/cdn.website1.com/ /var/www/cdn.website2.com/ /var/www/cdn.website3.com/ so cdn.website1.com will display content from /var/www/cdn.website1.com/ and so on I installed lighttpd and enabled vhost using command lighttpd-enable-mod simple-vhost and editted /etc/lighttpd/conf-available/10-simple-vhost.conf to simple-vhost.server-root = "/var" simple-vhost.document-root = "www" But when i access cdn.website2.com it still points to content at var/www/ and not from /var/www/cdn.website1.com/
Read the documentation at: http://redmine.lighttpd.net/projects/1/wiki/Docs_ModSimpleVhost It's explained with some examples. The way you have it set, it's displaying what you are telling it to (the document root /var/www). There is also guidance on handling multiple domain names (towards the bottom).