wamp server 2.5 虚拟主机VHOST安装配置

本文详细介绍了如何使用Apache配置多域名虚拟主机,包括修改hosts文件、httpd-vhosts.conf和httpd.conf等关键步骤,确保每个域名都能正确解析并提供服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

概要:

1.修改系统的域名解析文件C:\Windows\System32\drivers\etc\hosts(加你的域名,比如4个域名就要加4条)

2.修改D:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf(加你的域名接受,比如4个域名就加4个)

3.修改D:\wamp\bin\apache\apache2.4.9\conf\httpd.conf(改【2+域名数量】条,比如4个域名那就是6条)

详细描述:

1.修改系统的域名解析文件C:\Windows\System32\drivers\etc\hosts(加你的域名,比如4个域名就要加4条)


2.修改D:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf(加你的域名接受,比如4个域名就加4个)


<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.localhost
    DocumentRoot "d:/wamp/www/dede"
    ServerName www.tdede.com
    ErrorLog "dede-error.log"
    CustomLog "dede.log" common
</VirtualHost>

给懒人准备的文本


3.修改D:\wamp\bin\apache\apache2.4.9\conf\httpd.conf(改【2+域名数量】条,比如4个域名那就是6条)


查找这个Include conf/extra/httpd-vhosts.conf。去掉#号,图片中的我已经去除了。


注意那里写自己的文件目录。

<Directory "d:/wamp/www/crm">
    #
    # 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>

给懒人准备的文本



最后参考文献:

1.深坑,不要参考(少一步)----》    “wamp集成环境开启虚拟主机多站点功能” (百度经验)我先看的这个因为先入为主反复搞了几个小时,没有第三步的后面那步,坑死我了。

2.感谢

《wampserver 配置 vhost》

http://www.thinkphp.cn/topic/14458.html
干净利落的写清要点,救我于水火。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值