Chapter 8: Configuring Nginx and Apache
Common Mistakes I See Students Make
- Changing
DocumentRootbut not the matching<Directory>, then getting 403. - Saving backups as
site.conf.bak.conforsite-old.confinconf.d, which loads the same site twice (conflicting server name warning). - Forgetting the symlink on Ubuntu Nginx, or linking with a relative path that points nowhere (
ls -l sites-enabledshows broken links in red). - Writing
server_namewithhttp://, likeserver_name http://example.com;. Only the bare host name belongs there. - Pointing the web root at
/home/ec2-user/siteand changing home permissions to 777. - Opening a new port in the config but not in the security group.
- Disabling SELinux instead of using
semanage fcontext/semanage port. - Restarting without
nginx -tand taking the site down with a typo.