mac 開啓Apache服務器並打開一個html頁面

#啓動

sudo apachectl start

#重啓

sudo apachectl restar

#停止
 

sudo apachectl stop

# 訪問如下或者自己電腦的ip地址

http://127.0.0.1/
https://127.0.0.1/

#默認html文件存放路徑 注意替換掉原來的index.html文檔

/Library/WebServer/Documents

#自定義文件路徑 訪達->打開路徑

/etc/apache2

在目錄內找到httpd.conf  並打開

搜索”/Library/WebServer/Documents“

# DocumentRoot "/Library/WebServer/Documents"

更改路徑

DocumentRoot "/Users/MM/name"
<Directory "/Users/MM/name">

 

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