windows配置本地的虚拟主机

1. 打开apache 配置文件httpd.conf ,找到mod_rewrite.so,去掉注释

2.apache 配置文件httpd.conf ,找到httpd-vhosts.conf,去掉注释

3.打开httpd-vhosts.conf文件,配置本地虚拟主机路径和域名

4.打开hosts文件,C:\Windows\System32\drivers\etc目录下。配置域名解析。

5.解决Apache配置虚拟主机后,不能访问localhost问题

   Apache配置虚拟主机后,不能访问localhost,通过设置虚拟域名访问,把localhost变成虚拟域名

  ①编辑httpd-vhosts.conf,添加如下

 ②把httpd.conf文件的ServerName localhost 这行注释掉

 ③本地hosts文件里 localhost指向127.0.0.1

猜你喜欢

转载自blog.csdn.net/weixin_42075590/article/details/83651075