Ravindra BagaleCourses & study guides

Chapter 10: Dynamic Website Hosting (PHP, Python, Node.js with MySQL)

Common Mistakes I See Students Make

  • Hard-coding passwords in code and pushing to GitHub. Use .env files with permission 600 and add them to .gitignore.
  • Using localhost in Node.js and getting ECONNREFUSED ::1:3306. Use 127.0.0.1.
  • Running the app with node app.js in the SSH session and closing the terminal — the app dies. Use pm2 or systemd.
  • Running both pm2 and a systemd unit for the same app → port 3000 already in use.
  • Opening port 3306 or 3000 to the internet instead of using the reverse proxy.
  • Forgetting setsebool -P httpd_can_network_connect 1 on CentOS → 502 Bad Gateway.
  • Not restarting PHP-FPM/Apache after installing PHP modules.