在本地安装了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. Atom使用心得 - 21世纪的编辑器

    Atom使用心得 - 21世纪的编辑器 Atom下载 Atom简介:是专门为程序员推出的一个跨平台文本编辑器.具有简洁和直观的图形用户界面,并有很多有趣的特点:支持CSS,HTML,JavaScrip ...

  2. powerdesigner 绘制表关系和导出sql

    1.生成图(A图,B图) 2.创建关系(palette工具栏里有个线条,主表子表关系连接即可,拖动是由顺序的,一对多即从A表往B表连接) 3.这里小说一下   一开始是CDM模式,可以在软件最顶层看到 ...

  3. HTML5 中canvas支持触摸屏的签名面板

    1.前言 最近实在是太忙了,从国庆之后的辞职,在慢慢的找工作,到今天在现在的这家公司上班大半个月了,太多的心酸泪无以言表,面试过程中,见到的坑货公司是一家又一家,好几家公司自己都只是上一天班就走了,其 ...

  4. 云计算之路-阿里云上:2014年6月11日17点遇到的CPU 100%状况

    今天下午17:00-17:05之间,在请求量没有明显变化的情况下,SLB中的1台云服务器的CPU突然串到100%(当时SLB中一共有3台云服务器),见下图: 造成的直接后果是请求执行时间变得超长,最长 ...

  5. mongodb与sql语句对照表

    inert into users value(3,5) db.users.insert({a:3,b:5})     select a,b from users db.users.find({}, { ...

  6. [wikioi 1418]铃仙•优昙华院稻叶(东方幻想乡系列模拟赛)(树上递推)

    题目:http://www.wikioi.com/problem/1418/ 分析: 一看就肯定是树上的递推 设f[i][j][k]表示第i秒在k点(从j点走过来的)的概率 则f[i][j][k]=f ...

  7. [设计模式] javascript 之 单件模式

    单件模式说明 1. 说明:单件模式,就是静态化的访问中已经实例化的对象,这个对象只能通过一个唯一的入口访问,已经实例或待实例化的对象:面向对象语言如Java, .Net C#这样的服务端动态语言里,能 ...

  8. 第一章:javascript: 数据结构与算法

    在前端工程师中,常常有一种声音,我们为什么要学数据结构与算法,没有数据结构与算法,我们一样很好的完成工作.实际上,算法是一个宽泛的概念,我们写的任何程序都可以称为算法,甚至往冰箱里放大象,也要通过开门 ...

  9. EasyUI——实现展示后台数据代码

    下面是View显示代码: @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Layout.cshtml" ...

  10. Daily Scrum – 1/6

    Meeting Minutes 确认修复了一个bug,即变方的: 分配了以后的任务: 确认将速度写入了用户的设置文件 Burndown     Progress   part 组员 今日工作 Time ...