install nginx Centos

6 views May 26, 2022 admin 0

install nginx Centos

  1. ทำการ Remote SSH เข้า Server ผ่านโปรแกรม หรือ Console Terminal ผ่าน Z.com
  2. ใช้คำสั่ง sudo yum install epel-release เพื่อติดตั้ง EPEL Software
  3. ทำการติดตั้ง nginx ด้วยคำสั่ง sudo yum install nginx
  4. หากระบบถาม Is this ok ให้พิมพ์ y และ enter จากนั้นรอระบบติดตั้งจนขึ้น Complete
  5. สามารถเริ่มการทำงานของ Service nginx ด้วยคำสั่ง
    sudo systemctl start nginx
  6. ตรวจสอบว่าบริการกำลังทำงานหรือไม่ ด้วยคำสั่ง sudo systemctl status nginx
  7. หากมีการเรียกใช้งานไฟร์วอลล์ ให้ใช้คำสั่งต่อไปนี้ เพื่ออนุญาตการรับส่งข้อมูลผ่าน HTTP และ HTTPS :
    sudo firewall-cmd --permanent --zone=public --add-service=http
    sudo firewall-cmd --permanent --zone=public --add-service=https
    sudo firewall-cmd --reload
  8. ทดสอบเรียก Public IP ที่ Web Browser เพื่อยืนยันว่า Nginx ทำงานได้อย่างถูกต้อง

Was this helpful?