wamp2.1配置虚拟主机

  1. 修改配置文件httpd.conf,并去掉#Include conf/extra/httpd-vhosts.conf前面的#

  2. 修改apache/conf/extra/httpd-vhosts.conf <VirtualHost *:80>
        DocumentRoot "D:/wamp/www"
        ServerName localhost
        <Directory "D:/wamp/www">
            Options Indexes FollowSymLinks
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>
    <VirtualHost *:80>
            DocumentRoot "D:/wamp/www/PATH"
            ServerName DOMIN
            DirectoryIndex index.php
            <Directory />
                Options Indexes FollowSymLinks
                AllowOverride All
                Order allow,deny
                Allow from all
            </Directory>
    </VirtualHost>
  3. 修改C:\Windows\System32\drivers\etc,增加DOMIN
  4. 重启apache

    如果本地无法打开相应的域名,看看将AllowOverride 设置为All.

你可能感兴趣的:(localhost,配置文件,虚拟主机)