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