mac 配置本地apache
1、mac本身自帶apache服務器,隻需要修改3個文件的配置即可
2、打開finder前往文件夾 輸入/etc 找到apache2文件夾下的httpd.conf
修改文件中的代碼為
#AllowOverride none
#Require all denied
#2017-05-26
Require all granted
AllowOverride all
AllowOverride all
Allow from all
3、在apache2 中extra文件夾下打開httpd-vhosts.conf
修改文件中的代碼為
#ServerAdmin webmaster@mysite.local
DocumentRoot "/Users/xiekai/xn/"
ServerName w.xn.com
ServerAlias www.dummy-host.example.com
ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common
#DocumentRoot "/Users/teenker/xiekai/dev/"
#ServerName w.www.xiekai.com
<Directory /Users/xiekai/xn/>
Options All
Allow from All
AllowOverride All
</Directory>
4、在etc文件夾下打開hosts文件
修改如下
127.0.0.1 w.xn.com //自己配的地址
255.255.255.255 broadcasthost
::1 localhost
0.0.0.0 account.jetbrains.com
5、sudo apachectl restart
重啟服務即可 或者重啟電腦
網上資料 https://blog.csdn.net/simplty/article/details/43021375
最後更新:2017-07-26 11:03:18