ติดตั้ง Nginx บน Ubuntu 24+

Ubuntu 24+ by Keptcode.com

Last Updated: 2024-08-27 00:30

ดาวโหลด Docker Awesome จาก Githun.com

Path: [skeleton]

Terminal

# Clone โปรเจก จาก github
$ sudo git clone https://github.com/drivesoft-technology/docker-awesome.git

# ติดตั้ง Nginx เวอร์ชั่นล่าสุด (1.26.2)
$ bash docker-awesome/docker-install/install-nginx-on-ubuntu24.sh

# ตรวจสอบ
$ nginx -v # nginx version: nginx/1.26.2

ตั้งค่าและเปิดใช้งาน Nginx บน Ubuntu 24+

Path: [skeleton]

Terminal

# เปิดใช้งาน Nginx v1.26.2
$ sudo systemctl enable nginx && sudo systemctl status nginx

ปิดและเปิด Nginx Service ใหม่

Path: [skeleton]

Terminal

# Restart Nginx v1.26.2
$ sudo systemctl stop nginx && sudo systemctl start nginx && sudo systemctl status nginx

ตั้งค่า Command จัดการ Nginx

Path: [skeleton]

Terminal

# เปิดใช้งาน Nginx v1.26.2
sudo systemctl start nginx

# หยุดการใช้งาน
sudo systemctl stop nginx

# เปิด - ปิด Nginx
sudo systemctl restart nginx

# โหลด Nginx ใหม่
sudo systemctl reload nginx

# แสดงสถานะ
sudo systemctl status nginx