Install a web stack (Nginx, PHP, MySQL) on Ubuntu
Prepare a clean Ubuntu VPS to host PHP websites.
- Update the system:
apt update && apt upgrade -y. - Install the packages:
apt install nginx mysql-server php-fpm php-mysql -y. - Secure MySQL:
mysql_secure_installation. - Put your site in
/var/www/siteand create a server block in/etc/nginx/sites-available. - Test and reload:
nginx -t && systemctl reload nginx.
Tip: Add a free certificate afterwards with certbot --nginx.
