1、修改host文件
sudo vi /etc/hosts
2、
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
#127.0.0.1 localhost
在127.0.0.1前加上#注释,如上代码,
i进入编辑状态,结束后按esc,并:wq保存退出
3、重启apache
sudo apachectl restart
问题解决