zoukankan      html  css  js  c++  java
  • apache wamp虚拟目录设置

    wamp虚拟目录设置

    1、配置windows的hosts系统文件:

    C:/WINDOWS/system32/drivers/etc中的hosts文件中加上如下的内容
    127.0.0.1    local.baidu.com

    2、配置文件\wamp\bin\apache\Apache2.2.21\conf\httpd.conf,去掉#Include conf/extra/httpd-vhosts.conf前面的#

    3、打开apache的\wamp\bin\apache\conf\extra下的次配置文件httpd-vhosts.conf,修改如下

    将此文件下的原有的扩展配置文件(如下):复制一份并修改如下

    <VirtualHost *:80>
        ServerAdmin webmaster@dummy-host2.example.com
        DocumentRoot "D:/www/baidu/"
        ServerName local.baidu.com
        ErrorLog "logs/dummy-host2.example.com-error.log"
        CustomLog "logs/dummy-host2.example.com-access.log" common
    </VirtualHost>

    4、在httpd-vhosts.conf文件的末尾添加上(这里本要未配置):
      <VirtualHost *:80>
            DocumentRoot D:/www/baidu/
            ServerName local.baidu.com
            <Directory "D:/www/baidu/">
                Options Indexes FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from all
            </Directory>
      </VirtualHost>

    5、重启apache

    6、在地址栏输入local.baidu.com,将会显现本地站点

    但是这样localhost访问则出现了问题,这时需要我们,同样将localhost设为虚拟主机

    <VirtualHost *:80>
        ServerAdmin webmaster@dummy-host2.example.com
        DocumentRoot "D:/www/"
        ServerName localhost
        ErrorLog "logs/dummy-host2.example.com-error.log"
        CustomLog "logs/dummy-host2.example.com-access.log" common
    </VirtualHost>

  • 相关阅读:
    Eclipse+EPIC+PadWalker
    Commit message 和 Change log 编写指南
    把perl脚本编译成exe
    Qt使用中碰到的问题
    Python——函数 7、位置参数与默认参数之间的关系
    Python——函数 6、默认参数
    Python——函数 5、位置参数与关键字参数
    Python——函数 4、形参的应用
    Python——函数 3、实参与形参
    Python——函数 2、返回值
  • 原文地址:https://www.cnblogs.com/zper/p/3138848.html
Copyright © 2011-2022 走看看