วิธี Install Apache บน Centos

12 views May 26, 2022 admin 0

วิธี Install Apache บน Centos

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

Was this helpful?