Apache Http Server Windows環境安裝和啓動

下載

Apache官網上只提供了Linux系統的壓縮包,Windows版在Apache Windows版
在這裏插入圖片描述
點擊Files for Microsoft Windows
在這裏插入圖片描述
然後下載第一個
在這裏插入圖片描述
博主選擇的是x64的版本

安裝

把下載的文件httpd-2.4.38-o102r-x64-vc14-r2.zip解壓
用管理員打開Windows命令框cd到解壓文件的目錄下執行命令:

httpd.exe

在瀏覽器輸入http://localhost
如果瀏覽器打不開的話,可能是端口號被佔用了。
Apache默認的端口號是443,如果端口號衝突的話,會報以下錯誤在這裏插入圖片描述
然後將Apache24\conf\extra\httpd-ssl.conf和同路徑下的httpd-ahssl.conf文件中未註釋的443端口號改成442(博主442端口是空着的)
然後再執行:httpd.exe然後啓動Apache成功,在瀏覽器中輸入http://localhost訪問成功
在這裏插入圖片描述
其他命令:

關閉Apache        httpd -k stop
重啓Apache        httpd -k restart
卸載Apache        httpd -k uninstall
查看Apache版本     httpd -V
命令幫助           httpd -h

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章