Apache is a great web server, as it is incredibly popular, hence has a large amount of support for it, making it ideal for running dynamic websites that use add-ons such as PHP, as it’s all there for you, pre-configured & ready to install. But, that isn’t for everyone, many people may just want to setup a static HTML home page, with a few images here and there. The kind of stuff that a server just needs to send out, and not process. This is where LightTPD comes in. It is a very light (in terms of resources) server, just because out of the box it doesn’t work with languages such as PHP though, doesn’t mean that it won’t, it’s just that a tiny bit more work is required to get everything talking to each other. In this tutorial we will explain how to setup a simple LightTPD web server.

So, this will be the first and final setup, run the following command (remember you will need root access, and in this example I will assume you are logged in as root, if not prefix the command with sudo).

apt-get install lighttpd

You will need to confirm by pressing y when asked to, although other than that you will be done in a matter of minutes.

Once installed you will need to browse to the server as you would normally, through a web browser, e.g:

lynx localhost

For accessing the home page locally.

Or from another machine connected to the same network, open up your web browser and enter the servers IP address. This will present you with the default install screen.

By default all pages that LightTPD will serve are stored in /var/www, so anything that you want to be able to see will need to be placed in there.

Here are some example uses for a server run using LightTPD:

  • To act as a static content server for large webites (e.g. to server static images, javascript files, css).
  • To serve basic HTML based websites.
  • To run a web server of old/low end hardware.