Next Previous Contents

3. 測試 HTTPd

在你安裝完 HTTPd 後,以 root 遷入,並打入 httpd & 即 可執行它。 (假設你在獨立的系統上安裝好了 ) 現在你應該可以在 ps 的列表上看到它。最簡單的測試 HTTPd 的方法是使用 Telnet 。在 Linux 命令列裏鍵入

   linux:~$  telnet 172.16.0.1 80
在這裏 80 是 HTTP 的內定埠。如果你將 "Port" 設定成其不同 的埠號,那就換上它吧。你應該會得到一個像下面的回應
Trying 172.16.0.1...
   Connected to linux.mydomain.
   Escape character is '^]'.
現在, 如果你鍵入任何字元並按 Enter 鍵, 你應該會得到像下面的回應
   HTTP/1.0 400 Bad Request
   Date: Wed, 10 Jan 1996 10:24:37 GMT
   Server: NCSA/1.5
   Content-type: text/html

   <HEAD><TITLE>400 Bad Request < /TITLE> < /HEAD>
   <BODY><H1>400 Bad Request < /H1>
   Your client sent a query that this Server could
   not understand.<P>
   Reason: Invalid or unsupported method.<P>
   < /BODY>

現在我們已準備好使用另一台電腦及網頁瀏覽器來與這台伺服器相連接了。


Next Previous Contents