当我们需要使用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. 十.spring-boot添加jsp支持

    1.创建maven web project: 2.在添加web依赖 3.配置application.properties支持jsp 4.添加一个controller类 5.加入jsp页面 6.启动类 ...

  2. Xilinx Spartan6常用资源Verilog例化

    // DSP48A1 : In order to incorporate this function into the design, // Verilog : the following insta ...

  3. deferred rendering with msaa

    https://docs.nvidia.com/gameworks/content/gameworkslibrary/graphicssamples/d3d_samples/antialiasedde ...

  4. cglib Demo

    转载自:http://huihai.iteye.com/blog/858524 http://www.cnblogs.com/shijiaqi1066/p/3429691.html

  5. Leetcode--easy系列5

    #83 Remove Duplicates from Sorted List Given a sorted linked list, delete all duplicates such that e ...

  6. C# SQLite 创建数据库的方法增删查改语法和命令

    SQLite介绍 SQLite是一个开源.免费的小型RDBMS(关系型数据库),能独立运行.无服务器.零配置.支持事物,用C实现,内存占用较小,支持绝大数的SQL92标准. SQLite数据库官方主页 ...

  7. Hibernate关系映射(一) 基于外键的单向一对一

    模拟用户和地址的映射关系,一个用户只有一个地址,用户知道地址,但是地址不知道用户.用户对地址的单向一对一映射. 一.建立实体类 Account.cs类 package com.lxit.entity; ...

  8. 进程上下文切换 – 残酷的性能杀手(上)(转载cppthinker.com)

    对于服务器的优化,很多人都有自己的经验和见解,但就我观察,有两点常常会被人忽视 – 上下文切换 和 Cache Line同步 问题,人们往往都会习惯性地把视线集中在尽力减少内存拷贝,减少IO次数这样的 ...

  9. TCP 的那些事儿(上) SACK

    http://blog.csdn.net/woxiaozhi/article/details/27328557 文章太好了,转载过啦 这篇文章分为上下两篇  确实不错  所以存在这里收藏 TCP是一个 ...

  10. 【Pyhton 数据分析】通过gensim进行文本相似度分析

    环境描述 Python环境:Python 3.6.1 系统版本:windows7 64bit 文件描述 一共有三个文件,分别是:file_01.txt.file_02.txt.file_03.txt ...