Ravindra BagaleCourses & study guides

Chapter 11: Application Hosting — WordPress, Flask and Express

Interview Questions

Q1. What are the steps to host WordPress on an EC2 instance?
Install web server + PHP + MySQL/MariaDB, create DB and user, download and extract WordPress, configure wp-config.php with DB details and salts, set ownership/permissions, configure a vhost with URL rewriting, then complete the web installer.
Q2. Why use Nginx in front of Gunicorn?
Nginx handles slow clients, TLS, compression and static files efficiently and buffers requests, while Gunicorn focuses on running Python code.
Q3. What does wsgi:app mean in a Gunicorn command?
Import the module wsgi (wsgi.py) and use the object named app as the WSGI application.
Q4. How many Gunicorn workers should you run?
A common starting point is (2 × CPU cores) + 1, then tune based on load and memory.
Q5. What is the difference between pm2 restart and pm2 reload?
restart kills and restarts processes (brief downtime). reload restarts cluster workers one by one for zero downtime.
Q6. How do you make pm2 apps start after a reboot?
Run pm2 startup (and execute the printed command), then pm2 save to store the current process list.