配置虚拟主机

把网站配置成虚拟主机 域名为 www.***.com

 

具体步骤如下:比如讲apache服务器127.0.0.1 配置成 www.***.com

  1. 首先在http.conf文件中 做如下处理:

①默认的 DocumentRoot "C:/Apache2.2/htdocs“

②启用httpd-vhosts.conf文件 

# Virtual hosts 启用主机配置文件

Include conf/extra/httpd-vhosts.conf

2.windows/system32/dirvers/etc/hosts文件中加入

127.0.0.1 www.***.com

3.httpd-vhosts.conf文件中加入:

--简单配置方式

<VirtualHost 127.0.0.1:80>

    DocumentRoot "d:/myweb"

    DirectoryIndex my.html index.html index.htm index.php

    <Directory />

    Options FollowSymLinks

    AllowOverride None

    Order allow,deny

    Allow from all

    </Directory>

</VirtualHost>

posted @ 2017-04-07 00:44  kevinggk  阅读(125)  评论(0编辑  收藏  举报