Chapter 10

The Pi as a Web Server

ALTHOUGH THE PI is significantly less powerful than most devices you find in a data centre, that doesn’t mean that it can’t be a useful server in a home or business environment. Despite a small amount of memory and relatively underpowered processor, the Pi’s low power draw and silent running makes it a great choice for serving low-traffic simple pages to a local network or even out on the Internet.

A large proportion of modern web servers run a combination of Linux, Apache, MySQL and PHP—commonly referred to as a LAMP stack. Linux provides the underlying operating system, MySQL the database back-end, Apache the web server and PHP a scripting language for dynamic pages. Using a LAMP-based server, you can run some complex packages ranging from content management systems like WordPress to interactive forums like phpBB. All of this is possible with the Raspberry Pi as long as you don’t expect performance similar to that of a powerful commercial server.

Installing a LAMP Stack

If you’re running the recommended Raspbian distribution for the Raspberry Pi, you’re already one-quarter of the way to having a fully operational LAMP stack—specifically, you’ve already ...

Get Raspberry Pi User Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.