Raspberry Pi is great for building powerful server-based applications, configuring it to act as a web server by installing a web server such as Nginx, Apache, Jetty, or lighttpd. A web server can serve a web application to many users concurrently through a network. But unlike other traditional web applications, Raspberry Pi-hosted web applications can be used to interact with the Raspberry Pi itself, and other peripherals attached to it.
The following diagram shows a Raspberry Pi board configured as a web server with two clients connected to it through a router:
A lightweight web application can be used to interact with sensors and actuators attached to the Raspberry Pi. As an example, you could control an LED attached to a GPIO pin or display readings of a sensor attached to the I2C pins of the Raspberry Pi.
In this chapter...