ติดตั้ง LEMP Stack บน Ubuntu 22.04 (VM) แถมติดตั้ง phpMyAdmin

สร้าง VM Ubuntu

https://youtu.be/hTYzrvDL4lk

เซ็ตค่าเบื้องต้น Ubuntu และติดตั้ง Open SSH

sudo apt install net-tools
ifconfig
sudo apt install openssh-server
sudo service ssh status
กด q เพื่อออกจากการตรวจสอบสถานะ

ติดตั้ง LEMP Stack

ssh u6090059@<<ip address>>
sudo apt update
sudo apt install nginx
sudo chown -R u6090059:u6090059 /var/www/html
nano index.html
sudo apt install mysql-server
sudo mysql
CREATE USER 'u6090059'@'%';
ALTER USER 'u6090059'@'%' IDENTIFIED WITH mysql_native_password BY 'P@ssword1234';
GRANT ALL PRIVILEGES ON * . * TO 'u6090059'@'%';
FLUSH PRIVILEGES;
SELECT User, Host FROM mysql.user;
exit
sudo apt install php-fpm php-mysql
sudo nano /etc/nginx/sites-enabled/default
sudo nginx -t
sudo service nginx restart
cd /var/www/html
nano info.php

(แถม) ติดตั้ง phpMyAdmin

sudo apt install phpmyadmin
ให้กด tab มาที่ Ok แล้ว Enter (ไม่ต้องเลือก)
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin

--

--

Lecturer at Digital Innovation Technology, Rangsit University

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store