当我们需要使用Apache配置虚拟主机时,有可能会出现这个问题:Apache: You don't have permission to access / on this server

# 同IP不同域名
# Listen for virtual host requests on all IP addresses
NameVirtualHost *: <VirtualHost *:>
DocumentRoot "D:/lamp/phpweb/full"
ServerName full.thinkphp.com
</VirtualHost> <VirtualHost *:>
DocumentRoot "D:/lamp/core"
ServerName core.thinkphp.com
# Other directives here
</VirtualHost> <Directory "D:/lamp/core">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

我们使用上面的配置来实现基于不同域名的多站点配置,如果我不添加最后一段红色字体的部分,就会出现上面的问题,因为这部分的意思是

#
# 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>

这是Apache配置文件中的一段,大概意思就是'每一个Apache有权限访问的目录都需要配置,指定那个目录下的哪个服务是被允许的或者不被允许的',而默认是不能被访问的。

这里就找到了上面那个问题的原因了,如果我没有添加那段红色的字体部分,就表示,那个目录是不被允许访问的,所以就出现403错误。

注意:为什么第一个域名就不需要配置,那是因为,它放在'ServerRoot'目录下,所以是允许访问的。而第二个目录不在'ServerRoot'目录下,所以需要另外指定它允许的权限。

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 转自:http://blog.csdn.net/crazyboy20 ...

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

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

  3. Mac apache You don't have permission to access / on this server.

    在mac下配置完apache和php环境后,通过localhost访问页面,出现403Forbidden.页面提示: Forbidden You don't have permission to ac ...

  4. apache You don't have permission to access / on this server.无权访问

    环境:ubuntu16.4 apache2 原因:修改了apache web项目路径 解决: 1. 修改 /etc/apache2/sites-available/000-default.conf 文 ...

  5. WampServer phpadmin apache You don't have permission to access

    1.Forbidden You don't have permission to access / on this server. 后来咨询了一下朋友(php高手),说修改一下php的配置文件http ...

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

    测试时遇到将一本地目录设置为一apache的虚拟主机,在httpd-vhosts.conf文件中进行简单设置,然后在hosts文件中将访问地址指向本地,启动apache,进行访问,却出现了You do ...

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

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

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

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

  9. 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 ...

随机推荐

  1. latex不能识别eps图片

    latex中可以使用.eps的图片,许多文档都介绍了怎么引用这种格式的图片,但没有给出使用过程中的注意事项.我在使用MIKTEX的时候,latex文档中引入.eps图片遇到了这样的问题.编译的时候显示 ...

  2. .NET Oracle Developer的福音——ODP.NET Managed正式推出

    .NET Oracle Developer的福音--ODP.NET Managed正式推出   在.NET平台下开发Oracle应用的小伙伴们肯定都知道一方面做Oracle开发和实施相比SqlServ ...

  3. Android应用内使用新浪微博SDK发送微博(不调用微博客户端)

    需求 手头的一个应用需要添加分享到新浪微博的功能,这个功能在现在的应用上是非常的普遍的了. 分享到新浪微博,其实就是发送一条特定内容的微博,所以需要用到新浪微博SDK了. 微博SDK SDK的下载地址 ...

  4. window环境下备份与恢复(实际操作)

    C:\Documents and Settings\xuzhengzhu>sqlplus /nolog SQL*Plus: Release 10.2.0.1.0 - Production on ...

  5. jquery获取li里面的第一个a标签

    $("li").children("a:eq(0)") ; children()查找子元素,eq() 查找第几个 $('.active').children(& ...

  6. Python函数:使用谷歌翻译翻译英语字符串

    代码是同事写的,我把它单独抠出来,可以作为工具函数使用.当然,性能还是个问题,有待解决. import random import cookielib import urllib import url ...

  7. sql2012简体中文版安装

    sql2012简体中文版安装 导航 介绍 安装 先决条件 装.NET3.5 关闭Windows防火墙 运行Setup.exe 安装程序支持规则 产品密钥 许可条款 产品更新 安装安装程序文件 安装程序 ...

  8. LeetCode-NQueensII

    经典的N皇后问题, 这里学到了一个非常牛的新方法(http://www.matrix67.com/blog/archives/266),用位运算来求解N皇后问题: 思路其实也很容易懂,一点都不复杂, ...

  9. Android版俄罗斯方块的实现

    学习Android的基本开发也有一段时间了,可是由于没有常常使用Android渐渐的也就忘记了. Android编程学的不深,不过为了对付逆向,可是有时还是会感到力不从心的.毕竟不是一个计算机专业毕业 ...

  10. Excle中range的一些用法

    以下是一些range的简单用法 Sub aa() '-=============================================== '给B列设置填充颜色为黄色 Range(" ...