Ubuntu – Setting up simple vhost on lighttpd

lighttpdUbuntuvirtualhost

I've recently installed Lighttpd on Ubuntu 10.04. I used the standard concfig file without modification and placed my content in /var/www. I opened a browser typed in the URL www.myexample.co.uk and the content was delivered. Brilliant!

I need to use the server to host more than one web page so I configured the simple vhost module. I left the vhost config file /etc/lighttpd/conf-enabled/10-simple-vhost.conf almost as standard too:

simple-vhost.server-root = "/var/www"
simple-vhost.document-root = "html"
#simple-vhost.default-host = "www.example.com"

I then moved my content from /var/www to /var/www/myexample.co.uk/html/, restarted the server and opened my browser to test things out.

Now I see a page showing me Index of / which then has a link to a folder called myexample.com. Clicking on this delivers Index of /myexample.co.uk which has a link to a folder called html. Clicking on this serves up my content.

Clearly this isn't working how I intend it too. Any ideas would be much appreciated!

Best Answer

Guessing from http://redmine.lighttpd.net/wiki/1/Docs:ModSimpleVhost you still need a

simple-vhost.default-host = "example.org"

entry or similar. Does the hostname you are using match the directory name exactly?

Can you break the config file and see the service fail to start, to prove you are editing the config file it is using?

Related Topic