虚拟域名配置

1、进入 C:\Windows\System32\drivers\etc 这个文件夹,找到hosts文件,做相应配置;

比如:配置school.com 

# localhost name resolution is handled within DNS itself.
127.0.0.1 school.com
# ::1 localhost

 

2、找到 apache的conf/httpd.conf 文件,比如我的是在:D:\phpStudy\Apache\conf,在最后加上如下类似配置:

<VirtualHost *:80>
ServerName school.com
DocumentRoot D:\phpStudy\WWW\school\public //这里是你的项目入口
</VirtualHost>
这样就可以通过school.com访问项目了。
posted @ 2018-02-28 13:07  一轮明月随潮涌  阅读(191)  评论(0编辑  收藏  举报