Installing the web server
There are several web servers readily available that we could install on our Raspberry Pi, and they would all be suitable for our system. But I like the lighttpd web server as it's easy to use and lightweight. lighttpd is often referred to, and affectionately known as, "Lighty"—which to be honest is less of a mouthful than lighttpd.
As well as the Web server itself, we're also going to install PHP support, which will allow us to write dynamic web pages to interact with the Linux system. Now, to be honest, I'm not a massive fan of PHP for commercial Web-based deployments for many reasons, but for a small embedded-Linux system such as our home security system, it's perfect and works really well. It's also quite straightforward to get into if you've never done server-side Web-scripting as well.
To perform the following steps, you'll need to be logged into your Raspberry Pi via the terminal console (for example, PuTTY):
Update the package installer:
$ sudo apt-get update...