[php论坛]使用本地域名 访问本地项目,本地host文件配置 查看:4366  回复:5

1,在C:\Windows\System32\drivers\etc 下找到hosts文件,修改里面的内容,在最下边 添加 127.0.0.1 www.iot.com,在IP地址前按下 tab键,IP地址后加tab键.

image.png

image.png

2、修改 httpd.conf 文件

image.png

image.png

3、修改 httpd-vhosts.conf

image.png


#站点1 plc

<VirtualHost *:80>

    DocumentRoot "D:\xampp\htdocs\v4"

    ServerName www.plc.com

<Directory "D:\xampp\htdocs\v4">

    Options Indexes FollowSymLinks Includes ExecCGI

            AllowOverride All

            Require all granted

</Directory>

</VirtualHost>


#站点2 iot

<VirtualHost *:80>

    DocumentRoot "D:\xampp\htdocs\iot"

    ServerName www.iot.com

<Directory "D:\xampp\htdocs\iot">

    Options Indexes FollowSymLinks Includes ExecCGI

            AllowOverride All

            Require all granted

</Directory>

</VirtualHost>

http://www.plc.com/成功访问:

image.png

http://www.iot.com/ 成功访问:

image.png

当前第1页/总1页
ICP备案证书号: 苏ICP备14003016-2号