Tag Archives: virtualhost

Lighttpd and virtualhosts

Here a quick how to, about how to configure Lighttpd to run with Virtualhosts.
This has been installed and tested on a Raspberry Pi.

Enable modules:

Content of /etc/lighttpd/lighttpd.conf

To easily manage virtual hosts, edit /etc/lighttpd/conf-available/10-simple-vhost.conf

This configuration above will allow you to manage your virutalhosts simply storing them in a folder under /var/www/vhost
No extra configuration is needed from the server side.
Simply go into /var/www/vhost and create a folder named as the virtualhost you would like to manage.
In this particular case, please make sure to have a folder called error.default.loc with a page inside which will be displayed in case of ANY error.
For example, if you want to manage mysite.example.com, simply do the following:

…and put the html/php files inside that new folder! 🙂

To test if our webserver works, you can always use curl command as explained here.