局域网内配置Discuz,web端访问server端,出现以下反馈:


Forbidden

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


网上的各种方法,主要集中于把

<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>
改成
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
# Deny from all
Allow from all #允许所有访问
Satisfy all
</Directory> 以及把
<Directory "D:/Wamp5/www">

    #
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks #
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all #
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 </Directory>
改成
<Directory "D:/Wamp5/www">

    #
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks #
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all #
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Order Deny,Allow
# Deny from all # Allow from 127.0.0.1
Allow from all </Directory>

都没有效果。

从一位台湾省兄弟的博客(https://blog.longwin.com.tw/2014/03/apache-22-24-upgrade-conf-2014/)中看到,Apache2.2和2.4的设置方式是不一样的,总结如下:

    1. Deny All

      • 2.2 configuration:

        • Order deny,allow
        • Deny from all
      • 2.4 configuration:
        • Require all denied
    2. Allow All
      • 2.2 configuration:

        • Order allow,deny
        • Allow from all
      • 2.4 configuration:
        • Require all granted
    3. Allow HostDirectory 用 Require all granted
      • 2.2 configuration:

        • Order Deny,Allow
        • Deny from all
        • Allow from example.org
      • 2.4 configuration:
        • Require host example.org
    4. <Directory /var/>
      Options FollowSymLinks
      AllowOverride None
      Require all granted
      </Directory>

    5. FilesMatch 維持用 Order

      <FilesMatch ".+\.phps$">
      SetHandler application/x-httpd-php-source
      Order Deny,Allow
      Allow from all
      </FilesMatch>

也就是说,如果你用的是apache2.4,那么网上的那些方法基本上是没用的,得用新的设置方法。

然而,这些仍然没有解决我的问题。

走投无路的时候,翻到了conf/extra目录下的httpd-vhosts.conf,打开一看,内容如下:

<VirtualHost *:80>
ServerName localhost
DocumentRoot d:/wamp64/www
<Directory "d:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

很可疑,改一下试试,改成:

<VirtualHost *:80>
ServerName localhost
DocumentRoot d:/wamp64/www
<Directory "d:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

重启apache,成功!

现得知,httpd.conf中有一个选项,

#Virtual hosts

#Include conf/extra/httpd-vhosts.conf

用来指明是否使用额外的文件设置虚拟主机,这个选项在我这里默认是打开的:

#Virtual hosts

Include conf/extra/httpd-vhosts.conf

所以,apache使用的是conf/extra/httpd-vhosts.conf 这个文件里的设置。

所以,无论怎样设置httpd.conf,都是无效的。

You don't have permission to access的更多相关文章

  1. Forbidden You don't have permission to access / on this server PHP

    在新安装的谷歌游览器里,打不了PHP网站了,错误显示: Forbidden You don't have permission to access / on this server. 原因还是配置权限 ...

  2. wamp出现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 ...

  3. yii安装 /You don't have permission to access on this server

    在安装yii的时候 ,当打开了init.bat进行配置的时候小黑本弹出了个小黑框立刻就关闭了,  进入cmd模式再打开init.bat就出现了"You don't have permissi ...

  4. CentOS出错You don't have permission to access on this server

    之前配置phpmyadmin的时候,在浏览器上输入http://192.168.8.250/phpmyadmin/ 也遇到了You don't have permission to access on ...

  5. wampserver You don't have permission to access / on this server. 解决 方法(转,正好碰到这样的事情了就转下来)

    最近在安装最近版wampserver 2.2 d时发现安装好后启动服务器,访问localhost显示You don't have permission to access / on this serv ...

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

  7. Forbidden You don't have permission to access / on this server. You don't have permission to access /phpmyadmin/ on this server. 解决办法

    Forbidden  You don't have permission to access / on this server.   解决办法 打开 httpd.conf 文件, 将 #   onli ...

  8. 解决问题 “You don't have permission to access /index.html on this server.”

    前几天装一个linux 企业版5.0安装了apache,打开测试页面的时候出现如下错误: Forbidden You don't have permission to access /index.ht ...

  9. WAMP error: Forbidden You don't have permission to access /{you_app_name} on this server

    Forbidden You don't have permission to access /{you_app_name}on this server. 需要修改两处: wamp\bin\apache ...

  10. PHP错误:Forbidden You don't have permission to access / on this server.

    今天在测试一个php程序的时候,发现这个问题: Forbidden You don't have permission to access / on this server. 开始的时候我是用http ...

随机推荐

  1. 有关JSP隐式对象,以下( )描述正确。

    A.隐式对象是WEB容器加载的一组类的实例,可以直接在JSP页面使用 B.不能通过config对象获取ServletContext对象 C.response对象通过sendRedirect方法实现重定 ...

  2. erlang-百度云推送Android服务端功能实现-erlang

    百度云推送官方地址http://developer.baidu.com/wiki/index.php?title=docs/cplat/push 简单的介绍下原理: 百度云推送支持IOS和Androi ...

  3. 【Java面试题】50 垃圾回收器的基本原理是什么?垃圾回收器可以马上回收内存吗?有什么办法主动通知虚拟机进行垃圾回收?

    1.对于GC来说,当程序员创建对象时,GC就开始监控这个对象的地址.大小以及使用情况. 通常,GC采用有向图的方式记录和管理堆(heap)中的所有对象.通过这种方式确定哪些对象是"可达的&q ...

  4. 类似股软(大智慧)之键盘精灵的 vc2008--UNICODE 环境实现

    键盘精灵是指,当按下键盘上任意一个数字.字母或符号的时候,都会弹出“键盘精灵”,其类似于股票软件(如大智慧)中的.可以在这里面输入中英文和数字搜索您想要的东西.可以通过输入代码.名称或名称的汉语拼音首 ...

  5. python编码问题1

    爬虫,新手很容易遇到编码解码方面的问题.在这里总结下. 如果处理不好编码解码的问题,爬虫轻则显示乱码,重则报错UnicodeDecodeError: 'xxxxxx' codec can't deco ...

  6. 制作SD卡启动自己编译的uboot.bin

    README for FriendlyARM Tiny4412 -----------------------------------------------------1. Build uboot ...

  7. MySQL技术内幕:SQL编程 第2章 数据类型 读书笔记

    2.1 类型属性 2.1.1 UNSIGNED 数字无符号化, INT的值 -2147483648 ~ 2147483647  INT UNSIGNED的值 0 ~ 4294967295 int a ...

  8. Java架构学习 转(Spring+SpringMVC+MyBatis+easyUI)

    Spring+SpringMVC+MyBatis+easyUI : http://www.cnblogs.com/han-1034683568/p/6730869.html

  9. VS2015编译GEOS3.5.1源码

    官网下载下来的geos3.5.1,执行CMakeLists.txt,发现会报错:GenerateSourceGroups 去github上搜索geos,然后去\cmake\modules目录下复制一份 ...

  10. JS 添加js节点

    function AddScriptNode(src) { var N = document.createElement("script"); N.setAttribute(&qu ...