wampserver 配置 vhost

浏览:12581 发布日期:2014/05/30 分类:技术分享
1,用记事本打开apache目录下httpd文件(如:D:\wamp\bin\apache\apache2.2.8\conf),
1>找到如下模块# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
去掉Include conf/extra/httpd-vhosts.conf前面的#
2>找到类似如下代码<Directory "d:/wamp/www">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Require local
</Directory>
将d:/wamp/www改成d:/www


2,用记事本打开httpd-vhosts文件,配置好localhost虚拟主机,参照httpd-vhosts文件中实例,修改成如下(可以添加多个):<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "D:\www"
ServerName w.me
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" common
</VirtualHost>
3,打开host文件(C:\WINDOWS\system32\drivers\etc\hosts),增加一行代码
127.0.0.1 w.me
最佳答案
评论( 相关
后面还有条评论,点击查看>>