测试时遇到将一本地目录设置为一apache的虚拟主机,在httpd-vhosts.conf文件中进行简单设置,然后在hosts文件中将访问地址指向本地,启动apache,进行访问,却出现了You don't have permission to access / on this server的提示,baidu了一下,原来是因为我的虚拟主机目录为非apache安装目录下的htdocs,所以违反了apache对默认对网站根访问权限。

apache的默认虚拟主机根目录地址为../Apache Software Foundation/Apache2.2/htdocs 目录下,需要对httpd.conf文件进行修改才能指向其他目录。

在httpd.conf文件下找到这段:

  1. <span style="font-size: x-small;">#
  2. # Each directory to which Apache has access can be configured with respect
  3. # to which services and features are allowed and/or disabled in that
  4. # directory (and its subdirectories).
  5. #
  6. # First, we configure the "default" to be a very restrictive set of
  7. # features.
  8. #
  9. <Directory />
  10. Options FollowSymLinks
  11. AllowOverride None
  12. Order deny,allow
  13. Deny from all
  14. </Directory></span>
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>

将之修改为

  1. <span style="font-size: x-small;"># 允许指向外部的目录进行访问
  2. <Directory />
  3. Options Indexes FollowSymLinks
  4. AllowOverride None
  5. </Directory></span>
# 允许指向外部的目录进行访问
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory> <Directory /> 
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride None
</Directory>

然后重启apache,就ok了。

Apache提示You don't have permission to access / on this server问题解决的更多相关文章

  1. Apache提示You don't have permission to access / on this server 解决

    本文链接:https://blog.csdn.net/Niu_Eva/article/details/90741894 Apache提示You don’t have permission to acc ...

  2. apache 提示You don't have permission to access /test.php on this server.怎样解决

    原文:apache 提示You don't have permission to access /test.php on this server.怎样解决 关键字: Apache   403  For ...

  3. Mac OS X中配置Apache后提示You don't have permission to access / on this server

    根据这篇博客http://www.cnblogs.com/snandy/archive/2012/11/13/2765381.html,在mac系统中,配置的apache,配置完成后,提示 You d ...

  4. 输入http://localhost/,apache出现You don't have permission to access/on this server.的提示,如何解决?

    本地搭建wamp,输入http://127.0.0.1访问正常,当输入http://localhost/,apache出现You don't have permission to access/on ...

  5. Apache 2.4.27 局域网访问提示 You don't have permission to access / on this server

    问题: 本机用localhost和ip都可以访问,局域网不可以访问,并且出现提示 You don't have permission to access / on this server. 解决: 如 ...

  6. apache出现You don’t have permission to access / on this server问题的解决

    今天在部署一个系统时,在apache中新开了一个VirtualHost,然后设置了DocumentRoot,等访问时却提示“You don’t have permission to access / ...

  7. phpstudy无法访问主页,提示You don't have permission to access / on this server解决办法

    1.输入localhost提示:You don't have permission to access / on this server. 新版phpStudy为了安全,取消Apache和nginx列 ...

  8. php多站点配置以及Forbidden You don't have permission to access / on this server问题解决

    php多站点配置以及Forbidden You don't have permission to access / on this server问题解决 一.总结 一句话总结:我的问题是php的版本问 ...

  9. apache出现You don't have permission to access / on this server. 提示

    今天在新的linux上跑原来的代码,使用的虚拟主机的模式进行操作.几个相关的网站放在一个文件里,想法是通过网站列出的目录进行相应的网站进行操作.一切设置完成后,在浏览器中运行出现在You don't ...

随机推荐

  1. Bzoj 3505: [Cqoi2014]数三角形 数论

    3505: [Cqoi2014]数三角形 Time Limits: 1000 ms  Memory Limits: 524288 KB  Detailed Limits   Description

  2. wand(weak and)算法基本思路

    一般搜索的query比较短,但如果query比较长,如是一段文本,需要搜索相似的文本,这时候一般就需要wand算法,该算法在广告系统中有比较成熟的应该,主要是adsense场景,需要搜索一个页面内容的 ...

  3. yii中上传图片及文件

    Yii 提供了 CUploadedFile 来上传文件,比如图片,或者文档. 官方关于这个类的介绍 : http://www.yiichina.com/api/CUploadedFile CUploa ...

  4. Linux Foundation Secure Boot System Released

    As promised, here is the Linux Foundation UEFI secure boot system.  This was actually released to us ...

  5. SpringMVC 流程 配置 接口

    SpringMVC简介    一 流程介绍 1.角色划分 前端控制器(DispatcherServlet).请求到处理器映射(HandlerMapping).处理器适配器(HandlerAdapter ...

  6. php 获取某个月的周次信息

    在做统计的时候如果按照周统计 ,需要对某个月的周次信息进行计算,如果本月头一天不是星期一,则向上一个月取周一,本月最后的几天如果不能正好是一周,则忽略. 例如 2019-09月计算出来的结果 2016 ...

  7. art template前端模板引擎

    偶然看到后台有一段代码 采用的是art template的模板引擎 地址为 http://aui.github.io/artTemplate/ 这段代码很简洁 var html = template( ...

  8. hdu 4634 Swipe Bo 搜索

    典型的bfs模拟 (广度优先搜索) ,不过有好多细节要注意,比如图中如果是  R#  走到这个R的话就无限往右走了,这样就挂了~肯定到不了出口.还有一种容易造成死循环的,比如 #E## DLLL D. ...

  9. 【硬件】DELLserver硬件监控及DELL系统管理工具OMSA介绍

    1.1.1. DELLserver硬件监控及DELL系统管理工具OMSA介绍 本文介绍採用使用Nagios和OMSA监控DELLserver的硬件健康状态,Nagios监控的方式是NRPE模式,须要配 ...

  10. kafka介绍和集群环境搭建

    kafka概念:     kafka是一个高吞吐量的流式分布式消息系统,用来处理活动流数据.比方网页的訪问量pm,日志等,既可以实时处理大数据信息     也能离线处理.     特点:       ...