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!

link|improve this question
feedback

2 Answers

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?

link|improve this answer
feedback
up vote 0 down vote accepted

After some hacking around I managed to get it to work by setting /etc/lighttpd/conf-enabled/10-simple-vhost.conf up as follows:

simple-vhost.server-root = "/var/www"
simple-vhost.document-root = "html"
simple-vhost.default-host = "myexample.co.uk"

Basically I needed to set a default host value and get rid of the www part.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.