Ravindra BagaleCourses & study guides

Chapter 11: Application Hosting — WordPress, Flask and Express

Practice Questions and Lab Exercises

  1. List the steps to install WordPress on a LAMP server.
  2. Why does WordPress need AllowOverride All on Apache? What is the Nginx equivalent?
  3. What SELinux changes are needed for WordPress on CentOS Stream 9 and why?
  4. Why shouldn't you use the Flask development server in production? What does wsgi:app mean?
  5. Explain the Nginx location /static/ block with alias.
  6. What is pm2 cluster mode? What is the difference between pm2 restart and pm2 reload?
  7. Lab: Install WordPress on Ubuntu with Apache, attach an Elastic IP first, and publish a post.
  8. Lab: Install WordPress on Amazon Linux 2023 with Nginx + PHP-FPM.
  9. Lab: Deploy the Flask demo, then change the template, push/pull, and restart the service.
  10. Lab: Deploy the Express demo with pm2 cluster mode; reboot the instance and prove it came back automatically.

Quick Revision

  • WordPress = PHP + MySQL: install stack → create DB/user → download → wp-config.php + salts → ownership (www-data/apache) → vhost with AllowOverride All (or Nginx try_files ... /index.php?$args) → browser install. Use an Elastic IP.
  • Flask: venv → Gunicorn (wsgi:app, 2×CPU+1 workers) → systemd → Nginx proxy_pass + /static/ alias.
  • Express: NodeSource → pm2 (ecosystem file, cluster mode, startup, save) → Nginx upstream + proxy.
  • CentOS: httpd_can_network_connect, httpd_sys_rw_content_t for writable folders.