apache http server windows 下的安裝

如何在 Windows XP 環境下安裝 Apache HTTP Server。php

下載 Apache HTTP Server 2.2.8

Apache 的官方網站是 http://apache.org/html

Apache HTTP Server 的下載頁面是http://httpd.apache.org/download.cgi,該頁中會提示你可供下載的鏡像 (Mirror) 站點,好比http://apache.mirror.phpchina.com。在這個鏡像站點,你會看到不少目錄,請選擇 httpd/ 目錄,而後選擇 binaries/ ,而後選擇 win32/,而後選擇 apache_2.2.8-win32-x86-no_ssl.msi 下載。apache

或者你能夠直接輸入該安裝文件所在頁面的 URL 路徑:http://apache.mirror.phpchina.com/httpd/binaries/win32/瀏覽器

在 Windows XP 環境下安裝 Apache HTTP Server 2.2.8

雙擊 apache_2.2.8-win32-x86-no_ssl.msi 文件,開始安裝 Apache HTTP Server 2.2.8。安全

你會看到如下畫面:ide

installing Apache HTTP Server

點擊 Next,而後選擇 I accept the terms in the license agreeement,測試

installing Apache HTTP Server

點擊 Next ,會看到下圖:網站

installing Apache HTTP Server

而後點擊 Next,進入 Server Information 畫面,以下圖:code

installing Apache HTTP Server

在 Network Domain 的文本框裏輸入 localhost。orm

在 Server Name 的文本框裏輸入 localhost。

在 Administrator's Email Address 裏隨便輸入一個 Email 地址

而後選擇 for All Users, on Port 80, as a Service -- Recommended。

點擊 Next,選擇 Typical ,以下圖:

installing Apache HTTP Server

點擊 Next,進入 Destination Folder 畫面,以下圖:

installing Apache HTTP Server

點擊 Next,會看到安裝完成畫面,以下圖,點擊 Finish 結束安裝。

installing Apache HTTP Server

若是你還看到下面這個黑黑 Dos 界面,請不一樣擔憂,按 ESC 鍵退出便可。等會咱們須要修改一下 Apache HTTP Server 的配置文件。

installing Apache HTTP Server

修改 Apache HTTP Server 配置文件

安裝完 Apache HTTP Server 以後,還須要修改一下配置文件。

Apache 的配置文件路徑以下:

C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf

安全起見,建議你先備份一下這個文件。

而後用 Notepad 打開這個文件,修改端口設置。

Listen 80 改爲 Listen 8080

將 ServerName localhost:80 改爲 ServerName localhost:8080。

保存文件。

啓動 Apache Service

修改完配置文件以後,能夠啓動 Apache HTTP Server 了。

在 Windows 開始菜單選擇 Start --> All Programs --> Apache HTTP Server 2.2 --> Monitor Apache Servers,點擊後,你會看到在 Taskbar 有個小紅圖標,雙擊圖標打開 Apache Service Monitor 畫面,以下圖。

點擊 Start 按鈕開啓 Apache Service。

installing Apache HTTP Server

測試 Apache HTTP Server 是否正常運行

在瀏覽器裏輸入 http://localhost:8080/index.html,或者直接輸入 http://localhost:8080/。若是 Appache HTTP Server 正常運行的話,瀏覽器會顯示該文件。以下圖:

running Apache HTTP Server

該文件的路徑是:C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\index.html

htdocs 是 Apache HTTP Server 的缺省根目錄。

相關文章
相關標籤/搜索