WAMP配置虚拟主机

问题背景:从网上下载了一个PHP项目A,A项目需要部署在网站的根目录下。

配置虚拟主机可以解决这个问题。
1.打开Apache的配置文件httpd.conf,并去掉#Include conf/extra/httpd-vhosts.conf前面的#!!

2.打开Apache的apache/conf/extra下的次配置文件httpd-vhosts.conf

3.在末尾增加
<VirtualHost *:80>
        DocumentRoot "C:wampwwwdefault"
        ServerName localhost
        ServerAlias localhost
        ErrorLog "C:wampwwwdefault/default-error.log"
        CustomLog "C:wampwwwdefault/default.log" common
</VirtualHost>
4.重启Apache
5.访问
  http://localhost直接访问到default目录下。

---------------------------------------------------------
原文地址:https://www.cnblogs.com/qitian1/p/6462759.html