$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install nginx -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install nginx -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install nginx -y
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable nginx
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start nginx
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable nginx
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start nginx
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable nginx
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start nginx
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install mysql-server -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install mysql-server -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install mysql-server -y
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable mysql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start mysql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable mysql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start mysql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable mysql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start mysql
$ -weight: 600;">sudo mysql_secure_installation
$ -weight: 600;">sudo mysql_secure_installation
$ -weight: 600;">sudo mysql_secure_installation
$ -weight: 600;">sudo mysql
$ -weight: 600;">sudo mysql
$ -weight: 600;">sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_strong_password';
FLUSH PRIVILEGES;
EXIT;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_strong_password';
FLUSH PRIVILEGES;
EXIT;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_strong_password';
FLUSH PRIVILEGES;
EXIT;
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install php php-fpm php-mysql php-cli -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install php php-fpm php-mysql php-cli -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install php php-fpm php-mysql php-cli -y
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable php8.5-fpm
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start php8.5-fpm
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable php8.5-fpm
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start php8.5-fpm
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable php8.5-fpm
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start php8.5-fpm
$ php --version
$ php --version
$ php --version
$ -weight: 600;">sudo ufw allow 80/tcp
$ -weight: 600;">sudo ufw allow 443/tcp
$ -weight: 600;">sudo ufw allow 80/tcp
$ -weight: 600;">sudo ufw allow 443/tcp
$ -weight: 600;">sudo ufw allow 80/tcp
$ -weight: 600;">sudo ufw allow 443/tcp
$ -weight: 600;">sudo mkdir -p /var/www/app.example.com
$ -weight: 600;">sudo chown -R www-data:www-data /var/www/app.example.com
$ -weight: 600;">sudo mkdir -p /var/www/app.example.com
$ -weight: 600;">sudo chown -R www-data:www-data /var/www/app.example.com
$ -weight: 600;">sudo mkdir -p /var/www/app.example.com
$ -weight: 600;">sudo chown -R www-data:www-data /var/www/app.example.com
$ echo "<h1>Hello from LEMP on Ubuntu 26.04</h1>" | -weight: 600;">sudo tee /var/www/app.example.com/index.html
$ echo "<h1>Hello from LEMP on Ubuntu 26.04</h1>" | -weight: 600;">sudo tee /var/www/app.example.com/index.html
$ echo "<h1>Hello from LEMP on Ubuntu 26.04</h1>" | -weight: 600;">sudo tee /var/www/app.example.com/index.html
$ -weight: 600;">sudo nano /etc/nginx/sites-available/app.example.com.conf
$ -weight: 600;">sudo nano /etc/nginx/sites-available/app.example.com.conf
$ -weight: 600;">sudo nano /etc/nginx/sites-available/app.example.com.conf
server { listen 80; server_name app.example.com; root /var/www/app.example.com; index index.php index.html; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.5-fpm.sock; } access_log /var/log/nginx/app.example.com-access.log; error_log /var/log/nginx/app.example.com-error.log;
}
server { listen 80; server_name app.example.com; root /var/www/app.example.com; index index.php index.html; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.5-fpm.sock; } access_log /var/log/nginx/app.example.com-access.log; error_log /var/log/nginx/app.example.com-error.log;
}
server { listen 80; server_name app.example.com; root /var/www/app.example.com; index index.php index.html; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.5-fpm.sock; } access_log /var/log/nginx/app.example.com-access.log; error_log /var/log/nginx/app.example.com-error.log;
}
$ -weight: 600;">sudo ln -s /etc/nginx/sites-available/app.example.com.conf /etc/nginx/sites-enabled/
$ -weight: 600;">sudo nginx -t
$ -weight: 600;">sudo -weight: 500;">systemctl reload nginx
$ -weight: 600;">sudo ln -s /etc/nginx/sites-available/app.example.com.conf /etc/nginx/sites-enabled/
$ -weight: 600;">sudo nginx -t
$ -weight: 600;">sudo -weight: 500;">systemctl reload nginx
$ -weight: 600;">sudo ln -s /etc/nginx/sites-available/app.example.com.conf /etc/nginx/sites-enabled/
$ -weight: 600;">sudo nginx -t
$ -weight: 600;">sudo -weight: 500;">systemctl reload nginx
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install certbot python3-certbot-nginx -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install certbot python3-certbot-nginx -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install certbot python3-certbot-nginx -y
$ -weight: 600;">sudo certbot --nginx -d app.example.com --agree-tos
$ -weight: 600;">sudo certbot --nginx -d app.example.com --agree-tos
$ -weight: 600;">sudo certbot --nginx -d app.example.com --agree-tos
$ -weight: 600;">sudo certbot renew --dry-run
$ -weight: 600;">sudo certbot renew --dry-run
$ -weight: 600;">sudo certbot renew --dry-run
$ mysql -u root -p
$ mysql -u root -p
$ mysql -u root -p
CREATE DATABASE lemp_test;
CREATE USER 'lemp_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON lemp_test.* TO 'lemp_user'@'localhost';
USE lemp_test;
CREATE TABLE greetings (id INT AUTO_INCREMENT PRIMARY KEY, message VARCHAR(255));
INSERT INTO greetings (message) VALUES ('LEMP stack is working!');
FLUSH PRIVILEGES;
EXIT;
CREATE DATABASE lemp_test;
CREATE USER 'lemp_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON lemp_test.* TO 'lemp_user'@'localhost';
USE lemp_test;
CREATE TABLE greetings (id INT AUTO_INCREMENT PRIMARY KEY, message VARCHAR(255));
INSERT INTO greetings (message) VALUES ('LEMP stack is working!');
FLUSH PRIVILEGES;
EXIT;
CREATE DATABASE lemp_test;
CREATE USER 'lemp_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON lemp_test.* TO 'lemp_user'@'localhost';
USE lemp_test;
CREATE TABLE greetings (id INT AUTO_INCREMENT PRIMARY KEY, message VARCHAR(255));
INSERT INTO greetings (message) VALUES ('LEMP stack is working!');
FLUSH PRIVILEGES;
EXIT;
$ -weight: 600;">sudo nano /var/www/app.example.com/test.php
$ -weight: 600;">sudo nano /var/www/app.example.com/test.php
$ -weight: 600;">sudo nano /var/www/app.example.com/test.php
<?php
$conn = new mysqli('localhost', 'lemp_user', 'secure_password', 'lemp_test');
if ($conn->connect_error) { die('Connection failed: ' . $conn->connect_error); }
$result = $conn->query('SELECT message FROM greetings');
while ($row = $result->fetch_assoc()) { echo $row['message']; }
$conn->close();
?>
<?php
$conn = new mysqli('localhost', 'lemp_user', 'secure_password', 'lemp_test');
if ($conn->connect_error) { die('Connection failed: ' . $conn->connect_error); }
$result = $conn->query('SELECT message FROM greetings');
while ($row = $result->fetch_assoc()) { echo $row['message']; }
$conn->close();
?>
<?php
$conn = new mysqli('localhost', 'lemp_user', 'secure_password', 'lemp_test');
if ($conn->connect_error) { die('Connection failed: ' . $conn->connect_error); }
$result = $conn->query('SELECT message FROM greetings');
while ($row = $result->fetch_assoc()) { echo $row['message']; }
$conn->close();
?>
$ -weight: 600;">sudo rm /var/www/app.example.com/test.php
$ -weight: 600;">sudo rm /var/www/app.example.com/test.php
$ -weight: 600;">sudo rm /var/www/app.example.com/test.php - php: core PHP interpreter
- php-fpm: FastCGI Process Manager for Nginx
- php-mysql: MySQL driver for PHP database connections
- php-cli: command-line PHP interpreter - Deploy WordPress or Laravel on this stack
- Add phpMyAdmin for a browser-based database management interface
- Enable HTTP/2 in Nginx by adding http2 to the listen directive