Linux has no drive letters: there is one tree rooted at /, and every disk appears inside it at a mount point. The layout follows the Filesystem Hierarchy Standard 3.0 (2015), closely enough that you can guess right on an unfamiliar server.
| Directory | Holds | You use it for |
|---|---|---|
| /etc | Host configuration | Apache 129 , PHP, MySQL 524 , cron |
| /var/www | Served content | Your document root |
| /var/log | Log files | Debugging failed requests |
| /var/lib | Application state | The MySQL data directory |
| /run | Runtime data, cleared at boot | PID files, Unix sockets |
| /home, /root | Home directories | Your account, SSH keys |
| /usr/bin, /usr/sbin | Programs | php, mysql, apache2ctl |
| /tmp | World-writable scratch | Uploads in flight, sessions |
/bin, /sbin and /lib are now symbolic links into /usr (the "/usr merge"), so /bin/bash and /usr/bin/bash are one file. And a service started with PrivateTmp=yes gets its own /tmp, which is why a file PHP wrote there can be invisible from your shell (Overrides and Sandboxing).
Where the stack actually lives
Debian 319 and Ubuntu 225 split Apache's configuration into small files enabled by symlink with a2enmod and a2ensite, and call everything apache2. Red Hat systems keep one httpd.conf plus conf.d fragments and call everything httpd.
| Component | Debian and Ubuntu | RHEL 664 , Rocky, AlmaLinux 7,122 , Fedora 1,480 |
|---|---|---|
| Package and service | apache2 | httpd |
| Main Apache config | /etc/apache2/apache2.conf | /etc/httpd/conf/httpd.conf |
| Virtual hosts | /etc/apache2/sites-available/ | /etc/httpd/conf.d/*.conf |
| Modules | mods-available plus a2enmod | /etc/httpd/conf.modules.d/ |
| Error log | /var/log/apache2/error.log | /var/log/httpd/error_log |
| Apache runs as | www-data | apache |
| php.ini | /etc/php/8.5/<sapi>/php.ini | /etc/php.ini |
| PHP-FPM pool | /etc/php/8.5/fpm/pool.d/www.conf | /etc/php-fpm.d/www.conf |
| MySQL config | /etc/mysql/my.cnf | /etc/my.cnf, /etc/my.cnf.d/ |
Note the underscore in Red Hat's error_log: a tail copied from the wrong tutorial fails with "No such file or directory". PHP differs most. Debian gives every SAPI (cli, fpm, apache2) its own php.ini, so raising memory_limit for the command line does nothing for the web server. Ask each program.
php --ini | head -n 3 # the CLI's php.ini
php-fpm8.5 -i | grep 'Loaded Configuration' # the web server's php.ini
apache2ctl -V | grep -E 'HTTPD_ROOT|SERVER_CONFIG' # on RHEL: httpd -V
mysqld --verbose --help | grep -A1 'Default options' # my.cnf search orderConfiguration File (php.ini) Path: "/etc/php/8.5/cli" Loaded Configuration File: "/etc/php/8.5/cli/php.ini" Scan for additional .ini files in: "/etc/php/8.5/cli/conf.d" Loaded Configuration File => /etc/php/8.5/fpm/php.ini -D HTTPD_ROOT="/etc/apache2" -D SERVER_CONFIG_FILE="apache2.conf" Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf