局域网内配置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. Ubuntu13.04下Eclipse中文乱码解决

    参考:http://www.linuxidc.com/Linux/2011-12/50056.htm baoyu@baoyu:~$ gedit /var/lib/locales/supported.d ...

  2. SQL Server 备份和还原数据库

    备份: --完整备份 ) set @db_name = 'WSS_Content_Test'; ) set @db_location = 'D:\spbr0002\0000000B.bak'; --保 ...

  3. [转]JVM性能调优监控工具

    http://my.oschina.net/feichexia/blog/196575?p=1#comments JDK本身提供了很多方便的JVM性能调优监控工具,除了集成式的VisualVM和jCo ...

  4. jquery把int类型转换成字符串类型的方法

    jQuery中把获取的number类型数据转换成字符串类型 var val=$(“#id).val(); If(typeof val==”number”){ val+=' '; }

  5. SPP-Net

    R-CNN -> SPP-Net -> Fast-RCNN

  6. linux环境下,清空history中记录的历史命令

    需求描述: 今天在数据库主机上操作,通过history看到有刚操作过的历史记录,想把这个清除了, 但是,还不影响后续的命令记录,所以查了下,在此记录. 操作过程: 1.通过history -c命令,完 ...

  7. NHibernate连接oracle报错

    NHibernate.Exceptions.GenericADOException:“could not execute query [ select sys_user0_.USERID as USE ...

  8. 文件打包为zip格式文件下载

    整个思路是这样的: 1.查询数据库中的文件流放到datatable中2.循环datatable将文件流一个个生成文件,放到对应的文件夹中,3.下载某个文件夹下的所有文件a.循环这个文件夹下的所有文件, ...

  9. mybatis由浅入深day02_6延迟加载_延迟加载总结

    6 延迟加载 6.1 什么是延迟加载 需要查询关联信息时,使用mybatis延迟加载特性可有效的减少数据库压力,首次查询只查询主要信息,关联信息等用户获取时再加载. resultMap可以实现高级映射 ...

  10. ios开发之--ZHPickView输出格式不出现 +0000

    这样写就不会输出 +0000了 NSDate *select = [_datePicker date]; NSDateFormatter *dateFormatter = [[NSDateFormat ...