天天看點

win 7 學習搭建 apache 檔案伺服器

作者:WarAndPeace

Apache(音譯為阿帕奇)是世界使用排名第一的Web伺服器軟體。它可以運作在幾乎所有廣泛使用的計算機平台上,由于其跨平台和安全性被廣泛使用,是最流行的Web伺服器端軟體之一,小白也來體驗一下吧。

一、安裝

1、官網下載下傳:http://httpd.apache.org/

2、我這裡的安裝路徑和版本:D:\Apache Software Foundation\Apache2.2

win 7 學習搭建 apache 檔案伺服器

二、安裝服務

打開CMD,輸入指令:

httpd -k install

指定服務名稱:

httpd.exe -k install -n "MyServiceName"

MyServiceName換成你自己起的服務名稱

删除服務:

httpd.exe -k uninstall

或指定要删除的服務名稱:

httpd.exe -k uninstall -n "MyServiceName"

注意轉到運作路徑下執行指令D:\Apache Software Foundation\Apache2.2\bin。

三、啟動服務

1、輕按兩下ApacheMonitor.exe圖示,再輕按兩下右下角的圖示選擇服務啟動。

win 7 學習搭建 apache 檔案伺服器
win 7 學習搭建 apache 檔案伺服器

2、指令行啟動

httpd -k start

httpd.exe -k start -n "MyServiceName"

注意啟動路徑D:\Apache Software Foundation\Apache2.2\bin。

停止服務指令:httpd -k stop

httpd.exe -k stop -n "MyServiceName"
httpd.exe -k shutdown -n "MyServiceName"

重新開機服務:httpd -k restart

httpd.exe -k restart -n "MyServiceName"

3、windows計算機管理中啟動。

點選windows運作,輸入services.msc,打開apache服務,點選啟動。

win 7 學習搭建 apache 檔案伺服器
win 7 學習搭建 apache 檔案伺服器

四、運作效果

打開浏覽器輸入:localhost,如果出現:It works!,說明安裝成功。

win 7 學習搭建 apache 檔案伺服器

五、配置檔案伺服器

安裝成功後預設打開index.html預設網頁,把index.html重命名或删除,把要共享的檔案拷貝過去即可共享檔案。

win 7 學習搭建 apache 檔案伺服器
win 7 學習搭建 apache 檔案伺服器