การทำเครื่องของเราเป็น Web Server จริงๆ ตอนที่ 4

ขั้นตอนสุดท้าย สำหรับการทำเครื่องของเราให้เป็น เว็บ Server จริงๆ ก็คือการ Setup หรือปรับปรุง Windows ของเราเล็กๆน้อย เพื่อให้สามารถทำงานได้ และเพื่อรักษาความปลอดภัยขั้นต้นให้กับ Server

อันดับแรก ทำให้วินโดวส์ของเรารู้จัก Host ที่เราลงทะเบียนไว้ครับ

สำหรับผมใช้วินโดวส์ XP ให้เปิดไฟล์นี้เลยครับ C:\Windows\System32\drivers\etc\Hosts ด้วย Text editor อะไรก็ได้ครับ แล้วใส่บรรทัดนี้ลงไป

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host 127.0.0.1       localhost
192.168.1.2  demo.dydns.com

ซึ่งก็คือ IP ของเครื่องเรา และชื่อเว็บที่เราลงทะเบียนไว้ครับ

ถึงตอนนี้ เราก็สามารถเรียกเว็บไซต์ของเราผ่าน url นี้ได้เรียบร้อยแล้วครับ ลองพิมพ์ http://demo.dydns.com (หรือชื่อเว็บไซต์ที่ลงทะเบียนไว้) บน Address Bar ดูครับ มันจะต้องวิ่งไปยัง http://localhsot ของเรา (ต้องติดตั้ง Webserver เช่น PHP ไว้ก่อนแล้ว)

ตอนต่อไป เราจะมารักษาความปลอดภัยขั้นต้นให้กับ phpMyAdmin กัน
^