在本地安装了wamp环境,默认的根目录是D:\wamp\www,使用起来非常不方便。那如何改变默认的根目录呢

1,找到httpd.conf文件

D:\wamp\bin\apache\Apache2.2.21\conf

2,找到这个地方

  1. #
  2. # DocumentRoot: The directory out of which you will serve your
  3. # documents. By default, all requests are taken from this directory, but
  4. # symbolic links and aliases may be used to point to other locations.
  5. #
  6. #DocumentRoot "d:/wamp/www/"
  7. DocumentRoot "D:/webRoot/"

3,修改下面的代码

  1. <Directory "D:/webRoot/">
  2. #
  3. # Possible values for the Options directive are "None", "All",
  4. # or any combination of:
  5. # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  6. #
  7. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  8. # doesn't give it to you.
  9. #
  10. # The Options directive is both complicated and important. Please see
  11. # http://httpd.apache.org/docs/2.2/mod/core.html#options
  12. # for more information.
  13. #
  14. Options Indexes FollowSymLinks
  15.  
  16. #
  17. # AllowOverride controls what directives may be placed in .htaccess files.
  18. # It can be "All", "None", or any combination of the keywords:
  19. # Options FileInfo AuthConfig Limit
  20. #
  21. AllowOverride all
  22.  
  23. #
  24. # Controls who can get stuff from this server.
  25. #
  26.  
  27. # onlineoffline tag - don't remove
  28. Order Deny,Allow
  29. Deny from all
  30. Allow from 127.0.0.8
  31.  
  32. </Directory>

4,重启apache

5,如果出现403页面,需要把

  1. <Directory "D:/webRoot/">
  2. #
  3. # Possible values for the Options directive are "None", "All",
  4. # or any combination of:
  5. # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  6. #
  7. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  8. # doesn't give it to you.
  9. #
  10. # The Options directive is both complicated and important. Please see
  11. # http://httpd.apache.org/docs/2.2/mod/core.html#options
  12. # for more information.
  13. #
  14. Options Indexes FollowSymLinks
  15.  
  16. #
  17. # AllowOverride controls what directives may be placed in .htaccess files.
  18. # It can be "All", "None", or any combination of the keywords:
  19. # Options FileInfo AuthConfig Limit
  20. #
  21. AllowOverride all
  22.  
  23. #
  24. # Controls who can get stuff from this server.
  25. #
  26.  
  27. # onlineoffline tag - don't remove
  28. #Order Deny,Allow
  29. #Deny from all
  30. Allow from 127.0.0.8
  31.  
  32. </Directory>

apache如何配置默认的根目录的更多相关文章

  1. Apache配置默认主页

    Apache配置默认主页 进入Apache的conf目录 打开httpd.conf文件输入: 在文件末位添加: <Directory "F:/www_php/blog_com/my_b ...

  2. centos apache svn配置

    单独安装svn服务: 安装svn软件 yum install subversion 创建根目录 mkdir -p /var/www/svn 创建版本库repos svnadmin create /va ...

  3. phpnow修改默认站点根目录的方法

    本文转载自:http://blog.csdn.net/andy_eeipla/article/details/7832082 对于phpnow,经测试,修改Apache-20\conf\extra\h ...

  4. Apache服务器安装配置

    Apache服务器安装 1.Apache服务器安装      在Linux系统下,apache服务器的安装方式比较灵活,可以使用二进制包安装,比如:rpm包.deb包.已编译好的包.也可以简单的使用y ...

  5. Discuz!X2.5论坛在IIS和Apache环境配置实现伪静态

    最近在研究自己的网站,然后把这文章分享出来,让不清楚怎么设置的童鞋参考,高手可以飘过~~~ URL 静态化是一个有利于搜索引擎的设置,通过 URL 静态化,达到原来是动态的 PHP 页面转换为静态化的 ...

  6. LNMP + Apache 架构配置

    从事前端开发已3年有余,越来越发现前端开发要学习的知识已不仅仅是html+css+js那么简单了,2017年市场上就有了大前端的概念,可以说对前端工程师的要求也越来越高了,从招聘的要求中可以看到熟悉一 ...

  7. Apache的配置详解 带图

    对Apache 的 Http.conf 各项配置详解 1.01 ServerRoot 配置 [ServerRoot "" 主要用于指定 Apache 的安装路径,此选项参数值在安装 ...

  8. Apache + PHP配置

    因工作需要,重新配置了Apache和PHP.想起当年曾经配置过,但是已经忘得差不多了.而且,也没有记录.从我个人来看,确实缺乏这样的训练,从国家教育体系来看,似乎也从未有过做科学记录的训练.中国的瓷器 ...

  9. centos LAMP第二部分apache配置 下载discuz!配置第一个虚拟主机 安装Discuz! 用户认证 配置域名跳转 配置apache的访问日志 配置静态文件缓存 配置防盗链 访问控制 apache rewrite 配置开机启动apache tcpdump 第二十节课

    centos    LAMP第二部分apache配置  下载discuz!配置第一个虚拟主机 安装Discuz! 用户认证 配置域名跳转  配置apache的访问日志  配置静态文件缓存  配置防盗链 ...

随机推荐

  1. 做leetcode的几点体会分享(转)

    1 大部分题目你都是可以自己做出来的.所以,第一遍尽量不要网上找答案: 2 写了的不管通过的,不通过的答案要保存下来.不通过的,也要记录下来哪儿没有通过.很有可能你这次错了,不知道怎么搞过了,下次还是 ...

  2. Linux及安全——模块

    Linux及安全——模块 一.模块的编译.生成.测试.删除 1.编写模块代码 编写:gedit test.c 查看:cat test.c 2.查看版本信息 3.编写Makefile obj-m :这个 ...

  3. 关于ARP攻击的原理以及在Kali Linux环境下的实现

    关于ARP攻击的原理以及在Kali Linux环境下的实现 全文摘要 本文讲述内容分为两部分,前半部分讲述ARP协议及ARP攻击原理,后半部分讲述在Kali Linux环境下如何实现ARP攻击以及AR ...

  4. 尝试EJB整合Mybatis部署时报错:获得带有类加载器MybatisUtil的ModuleClassLoader的反射信息出错,请问大神如何解决

    mybatis的配置 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configurati ...

  5. JavaScript里面三个等号和两个等号有什么区别?

    1.对于string,number等基础类型,==和===是有区别的 a)不同类型间比较,==之比较“转化成同一类型后的值”看“值”是否相等,===如果类型不同,其结果就是不等 b)同类型比较,直接进 ...

  6. Mac 下安装tomcat

    一. 下载tomcat 首先要到tomcat官网去下载安装包,官网下载地址如下:http://tomcat.apache.org/download-70.cgi , 注意请下载飞windows版本.和 ...

  7. js中定时器的使用

    1.setInterval <!DOCTYPE html> <html> <head> <title>json</title> <sc ...

  8. 16.C#初见Lambda表达式及表达式树(九章9.1-9.3)

    在说明Lambda相关知识前,我们需要了解Lambda表达式常用于LINQ,那么我们来聊下LINQ. LINQ的基本功能就是创建操作管道,以及这些操作需要的任何状态.这些操作表示了各种关于数据的逻辑: ...

  9. Beta冲刺阶段

    Beta冲刺阶段 现阶段工作安排以及问题解决 Struts2框架配置 网上下载Struts 2 的框架代码,按照书上教程进行配置 遇到的问题:书上配置过程和实际操作有出入,按照书上过程无法完成配置过程 ...

  10. WebForm之Linq组合查询

    组合查询 protected void Button1_Click(object sender, EventArgs e) { //默认查询所有,返回的是Table类型,转换成IQueryAble类型 ...