A hosting control panel is a very good lie. It shows you a file manager, a dropdown that switches PHP versions and a green dot beside the word Apache 129 , and its whole job is to keep you from thinking about the operating system underneath. That works until the site returns 500 to everyone, the dot stays green, and the only thing that will tell you why is a log file the panel does not display, written by a process it does not list, owned by a user it never named.
The L in LAMP is the layer the other three letters stand on. Apache is a set of processes that something has to start at boot and restart after a crash. MySQL 524 is a daemon with a data directory, a socket file and an account that owns them. PHP runs as a pool of workers whose ability to read your code and write your uploads is decided by permission bits. A module that will not load or a framework that cannot write its cache is a Linux problem wearing a different hat, and not fixable from a web form.
This chapter is the working set, not a system administration certification: the shell and filesystem, users and permissions, packages, services that survive a reboot, firewalls, SSH, scheduled jobs and logs, a local stack, an EC2 24 instance on AWS 24 , and a TLS certificate that renews itself. Apache, MySQL and PHP configure Apache, MySQL and PHP on top of it. By the end you can take an empty server, put a working LAMP stack on it, keep it running, and find the one log line that explains an outage.
What you will learn
How distributions differ, and how to pick a support window that outlives your project
The shell, the filesystem hierarchy, pipes, and the tools that turn a log into an answer
Users, groups, permission bits and sudo, including the access a web server actually needs
Installing the stack with apt and dnf, and keeping security patches automatic
Writing systemd 142,543 units so your application starts at boot and restarts when it dies
Opening ports safely at both layers: ufw 280 or firewalld 292,900 , and cloud security groups
Running the stack under WSL2 6 , WampServer 861,070 or Docker 514 , and on an EC2 instance you launch
Issuing and auto-renewing Let's Encrypt 1,144 certificates with Certbot 1,690