How to Install LEMP Stack Linux on Ubuntu 24.04

MivoCloudMivoCloud Shared Hoster

Hi, I made a video that will help you install this tool on your server

The LEMP Stack (Linux, Nginx, MySQL/MariaDB, and PHP) is a group of free and open-source software applications for hosting and developing PHP web applications. The LEMP Stack can be used to deploy both static and dynamic web applications.

Commands Used:
sudo apt update sudo apt upgrade -y
sudo apt install nginx
sudo systemctl is-enabled nginx
sudo systemctl status nginx
sudo ufw status
sudo apt install mariadb-server
sudo systemctl is-enabled mariadb
sudo systemctl status mariadb
sudo mariadb-secure-installation
sudo apt install php-fpm php-mysql php-curl php-gd php-json php-intl php-bcmath php-opcache php-apcu php-mbstring php-fileinfo php-xml php-soap php-tokenizer php-zip
sudo systemctl is-enabled php8.3-fpm
sudo systemctl status php8.3-fpm
ss -pl | grep php
sudo nano /etc/nginx/sites-available/default
sudo nginx -t
sudo systemctl restart nginx
echo "?php phpinfo(); ?" /var/www/html/info.php
mkdir -p /var/www/newsite/public_html
echo "Welcome to newsite.com" /var/www/newsite/public_html/index.html
sudo chown -R www-data:www-data /var/www/newsite
sudo nano /etc/nginx/sites-available/newsite

server {
listen 80;
server_name newsite.com;

root /var/www/newsite/public_html;
index index.html;

location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}

location / {
try_files $uri $uri/ =404;
}
}

sudo ln -s /etc/nginx/sites-available/newsite /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

Tagged:
Sign In or Register to comment.