手机访问本地配置域名下的项目

第一步

先在本地环境中的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:\Windows\System32\drivers\etc 找到hosts文件 配置本机IP和自己配置的域名

192.168.1.144      nadmin.scoope.net

 

posted @ 2019-10-28 14:26  牛奔  阅读(558)  评论(0编辑  收藏  举报