测试时遇到将一本地目录设置为一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文件下找到这段:

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 FollowSymLinksAllowOverride NoneOrder deny,allowDeny from all
</Directory>

将之修改为

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

<Directory />      Options Indexes FollowSymLinks ExecCGI     AllowOverride None </Directory>

然后重启apache,就ok了。

转载于:https://www.cnblogs.com/yasuo/p/5477509.html

Apache提示You don't have permission to access / on this server问题解决相关推荐

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

    Apache提示You don't have permission to access / on this server问题解决 参考文章: (1)Apache提示You don't have per ...

  2. 【Apache】You don't have permission to access / on this server.问题解决

    目录 背景 正文 总结 背景 在服务器中输入localhost出现 Forbidden,You don't have permission to access / on this server. 在外 ...

  3. 输入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 ...

  4. 解决Apache提示“You don‘t have permission to access...“错误

    目录 解决Apache提示"You don't have permission to access..."错误 解决Apache提示"You don't have per ...

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

    关键字: Apache   403  Forbidden 系统配置: 操作系统:Red Hat Linux 6.2 Web服务器:Apache 3.1.1+jakarta-tomcat 3.1.1 数 ...

  6. Linux Centos7 Apache 访问 You don't have permission to access / on this server.

    折腾了很久,今天才找到了最正确的答案.感言真不容易. 百度出来的99%都是采集的内容,全都是错误的. You don't have permission to access / on this ser ...

  7. You don't have permission to access / on this server提示 求解决办法~

    提示You don't have permission to access / on this server..Apache定义了默认对网站根的访问权限. # Each directory to wh ...

  8. [备忘][转载]apache 403错误 You don't have permission to access on this server

    apache 403错误 You don't have permission to access on this server. 在配置好了Apache服务器后,测试已经通过了,但是通过浏览器访问lo ...

  9. 问题解决:Apache: You don't have permission to access / on this server

    虚拟主机(Virtual Host)是指在一个机器上运行多个网络站点 (比如:www.company1.com和www.company2.com). 如果每个网络站点拥有不同的IP地址,则虚拟主机可以 ...

  10. (已解决)wamp + Apache报错:出现403Forbidden You don't have permission to access / on this server.

    文章目录 `解决办法:` `*** `附件 · 延伸阅读 · 参考: 解决办法: 注意: 案例环境:win7 x64 或 win10 仅仅只需要修改apache配置文件httpd.conf 即可. 上 ...

最新文章

  1. 用简单的例子说明提升可复用性的设计模式
  2. 《犯罪心理学》读书笔记(part7)--犯罪心理的主观差异(中上)
  3. 在浏览器控制台执行以下代码,输入的结果是()
  4. java 写oracle clob_Java将数据写入Oracle的Clob字段中
  5. grep命令与正则表达式
  6. 快捷键截屏_Windows10自带截屏快捷键使用方法大全
  7. yii2 mysql 队列_yii2.0 中的队列
  8. 腾讯WebQQ 3.0 密码、验证码加密算法分析
  9. 《jdk8u源码分析》jvm.dll接口列表
  10. worder字体网页字体对照表
  11. 【面试】阿里巴巴Java经典面试题整理及答案详解
  12. 计算机科学与技术考研吧,计算机科学与技术考研学校排名
  13. 北京林业大学matlab公选课,北京林业大学视频类公共选修课学习指引-北京林业大学教务处.DOC...
  14. macos下安装john the ripper并配置zip2john
  15. An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
  16. telegram协议构架能实现朋友圈或者新浪微博功能么?
  17. 郭德纲的网络效应和网络利用
  18. 网络安全初学者工具安装:Kali,Windows xp虚拟机,pikachu靶场,burpsuite安装配置,phpstudy安装(学习笔记)
  19. USB转RS422带隔离电路设计(CAIS3082W替代方案)
  20. 支付宝/云闪付个人免签

热门文章

  1. Markdown(六)——表格合并单元格增加标题
  2. 【数据库原理实验(openGauss)】创建数据库、表和索引
  3. 基于Zephyr在微型MCU上使用Tensor Flow Lite Micro做图像分类
  4. QT--学习疑惑探索
  5. 他山之石,可以攻玉--从伪代码的角度来理解排序算法
  6. linux nfs文件共享
  7. 【第10章】深入理解Session与Cookie
  8. 2016-08-12
  9. QCon北京2015:移动开发最佳实践专题前瞻
  10. 手机团购,团购市场的下一引爆点