php虚拟主机配置( 输入网址 对应 ip地址)

1、启动http_vhost.conf文件

在httpd-conf中,#virtual hosts

去掉前面的井号 # Includeconf/extra/httpd_vhost.conf

2、配置httpd_vhost.conf

<virtualHost 127.0.0.1:80>

 Dcoument "你的网站文件夹所在目录 d:/myblog"

  #配置首页

  DircoryIndex index.html

  <Dirctory />

  options FllowSymLinks

  #不允许别人修改我们的页面

  Allowoverride None

  #设置访问权限

  order allow,deny

  Allow form all

  </Directory>

</virtualHost>

3、修改本地的hosts文件(如果在网络上的dns服务器可以查到你的域名对应的ip地址,就不需要修改本地的hosts文件)

window/systems32/divers/ect/host

IP   对应的  域名

127.0.0.1   www.gaidalou.com

posted @ 2018-03-16 17:00  盖大楼  阅读(877)  评论(0编辑  收藏  举报