1.找到 C盘 window->system32->drivers->etc->hosts文件用记事本打开,往里面添加
2.找到在C盘xampp目录进入apache->conf->extra->httpd-vhosts.conf文件,记事本打开在最后添加
<VirtualHost *:80>
ServerAdmin admin@xiaoq.com
DocumentRoot "C:\xampp\htdocs"
ServerName www.lucian.com
<Directory />
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
解析 DocumentRoot 为服务器访问的目录; ServerName 为刚才设置的虚拟域名。
重启apache服务器就可以访问了