第一步
先在本地环境中的Apache中找到httpd-vhosts.conf文件
然后在httpd-vhosts.conf中先把ServerName 修改为本地IP,然后把Deny from all 用#注释掉
<VirtualHost *:80> DocumentRoot "E:/scoopeAR/scoope-yii-2/backend/web/" ServerName 192.168.1.144 ServerAlias nadmin.scoope.net <Directory "E:/scoopeAR/scoope-yii-2/backend/web/"> AllowOverride All <IfDefine APACHE25> Require local </IfDefine> <IfDefine !APACHE25> Order Deny,Allow # Deny from all Allow from 127.0.0.1 localhost ::1 </IfDefine> </Directory> </VirtualHost> <VirtualHost *:80>
第二步
在C:WindowsSystem32driversetc 找到hosts文件 配置本机IP和自己配置的域名
192.168.1.144 nadmin.scoope.net