Chapter 6: Web Servers — Nginx and Apache
Common Mistakes I See Students Make
- Installing both Nginx and Apache and starting both → Address already in use on port 80.
- Editing the config but not reloading the service, then wondering why nothing changed.
- Putting files in
/var/www/htmlwhile Nginx on Amazon Linux serves/usr/share/nginx/html. - Using
apache2commands on Amazon Linux/CentOS (it ishttpdthere). - Disabling SELinux permanently instead of fixing labels or booleans.
- Adding comments at the end of an Apache directive line (Apache does not allow inline comments).
- Forgetting the semicolon
;at the end of an Nginx directive —nginx -twill tell you the exact line.