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">

 

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