Automatically translated.View original post

What is a webserver...???

# Trending # Drug sign with lemon8 # Web Site Writing Basics # webserver

What is Web Server? Explain it in 5 minutes. If the Internet world is compared to a large city, Web Server is a "building or store" located at various addresses (IP Address), which provides the services requested by the customer (Browser). Technically, Web Server has two synergies: Hardware side: a computer that is left open for 24 hours. It is highly stable to store your project files (HTML, CSS, JavaScript, images) on the software side: the running program is on the machine. It serves to "receive commands" through the HTTP protocol and "send data" back to the user. 2. The principle of operation: faithful servant when you type in the name of a website in the browser (such as Chrome, Firefox). What happens is: Request: The browser will send a request to the Web Server, "Request for the first file of this web." Processing: Web Server, check if there is a file? If it is a complex web (such as Node.js or PHP), it will process it before Response (Reply): the Server sends the file back to Browser to show us a beautiful web page 3. The key components of a Web Server to run a website usually include four main parts (which IT people often call Stack): Operating System: Operating System, such as Ubuntu Server (which you are using) Web Server Software: Manager programs, such as Nginx or Apache (which serve to receive customer queues) Database: Database, such as MySQL or MongoDB (to store subscriber or product information) Scripting Language: Processing Language, such as Node.js, Python, or PHP4. The type of Web Server that is popular today, named Nginx, handles job queues very quickly (High Performance). It is popular to make an outpost (Reverse Proxy). Apache is easy to customize, flexible, with many add-on modules. It is the old standard of the world. Node.js (as Runtime) can behave as a built-in Web Server. It fits apps that need real-time speed and communication.

1/28 Edited to

... Read moreจากประสบการณ์ของผม การเข้าใจ Web Server ไม่จำเป็นต้องซับซ้อนอย่างที่คิด เมื่อเราทราบว่า Web Server นั้นเปรียบเสมือน "ร้านค้า" ในโลกอินเทอร์เน็ต ที่คอยให้บริการข้อมูลเมื่อลูกค้าหรือ Browser ร้องขอ ก็จะมองเห็นภาพรวมได้ชัดเจนขึ้น แถมยังช่วยในเรื่องการตั้งชื่อโดเมนและเลือกโฮสติ้งได้เหมาะสมกับความต้องการของเว็บไซต์ด้วย สำหรับคนที่เริ่มต้น ฝั่ง Hardware ของ Web Server คือคอมพิวเตอร์ที่เปิดใช้งานตลอด 24 ชั่วโมง มีความเสถียรสูง เพื่อจัดเก็บไฟล์เว็บไซต์ต่างๆ เช่น HTML, CSS, JavaScript และรูปภาพ ส่วน Software คือโปรแกรมที่รันอยู่บนเครื่องนั้นทำหน้าที่รับคำขอผ่านโปรโตคอล HTTP แล้วตอบกลับข้อมูลตามที่ร้องขอจริง ๆ ภาพในการ OCR ที่เห็นแสดงให้เห็นกระบวนการทำงานของ Web Server อย่าง Nginx คู่กับ Node.js บนระบบปฏิบัติการ Ubuntu ซึ่งผมเองก็ใช้งานในโปรเจ็กต์ส่วนตัว พบว่าวิธีนี้ช่วยจัดการคำขอได้รวดเร็วและประมวลผลเรียลไทม์อย่างมีประสิทธิภาพ เหมาะกับเว็บไซต์ที่ต้องการการสื่อสารแบบทันทีทันใด นอกจากนี้ ส่วนประกอบของ Web Server หรือที่บางครั้งเรียกกันว่า Stack นั้น รวมไปถึงระบบปฏิบัติการ, โปรแกรม Web Server เช่น Nginx หรือ Apache, ฐานข้อมูลอย่าง MySQL หรือ MongoDB และภาษาสคริปต์เช่น PHP, Python หรือ Node.js ซึ่งการรู้จักส่วนประกอบเหล่านี้จะช่วยให้สามารถปรับแต่งและแก้ไขปัญหาเว็บเซิร์ฟเวอร์ได้เองอย่างมั่นใจ โดยสรุปแล้ว Web Server เป็นหัวใจสำคัญของการให้บริการเว็บ หากเข้าใจหลักการทำงานและประเภทต่าง ๆ ในปัจจุบันนี้จะช่วยให้เราสามารถเลือกใช้เครื่องมือที่เหมาะสมกับโปรเจ็กต์ของเราได้ดียิ่งขึ้น และยังช่วยเพิ่มประสิทธิภาพของเว็บไซต์ให้ตอบสนองผู้ใช้งานได้อย่างรวดเร็วมากขึ้นอีกด้วย