You don't have permission to access
局域网内配置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的设置方式是不一样的,总结如下:
- Deny All
- 2.2 configuration:
- Order deny,allow
- Deny from all
- 2.4 configuration:
- Require all denied
- 2.2 configuration:
- Allow All
- 2.2 configuration:
- Order allow,deny
- Allow from all
- 2.4 configuration:
- Require all granted
- 2.2 configuration:
- 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
- 2.2 configuration:
<Directory /var/>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>- 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的更多相关文章
- Forbidden You don't have permission to access / on this server PHP
在新安装的谷歌游览器里,打不了PHP网站了,错误显示: Forbidden You don't have permission to access / on this server. 原因还是配置权限 ...
- 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 ...
- yii安装 /You don't have permission to access on this server
在安装yii的时候 ,当打开了init.bat进行配置的时候小黑本弹出了个小黑框立刻就关闭了, 进入cmd模式再打开init.bat就出现了"You don't have permissi ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 解决问题 “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 ...
- 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 ...
- 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 ...
随机推荐
- ubuntu下使用VI编辑文件必知的常用命令
进入vi的命令 vi filename :打开或新建文件,并将光标置于第一行首 vi +n filename :打开文件,并将光标置于第n行首 vi + filename :打开文件,并将光标置于最后 ...
- erlang的简单模拟半包的产生
gen_tcp:linsten()/2使用的是{packet,2/4/8},则gen_tcp模块在接受或者发送时自动除去包头或者自动加上包头. 本例中使用的是{packet,0}. -module( ...
- vncserver的安装和使用
环境:RedHat Linux 6企业版.Xwindows:gnome (红帽默认安装的图形界面) 尽管我们可以使用SSH连接远程通过字符界面来操作Linux,但是对于更多熟悉图形人来说是很不方便的, ...
- 3D游戏与计算机图形学中的数学方法-点线面
<易传·系辞上传>:”易有太极,是生两仪,两仪生四象,四象生八卦.” 借用一下古代先人们的智慧引一下本文的主题-三维图形中的点线面,在三维几何中也有一句话可以和上面的话相对应:由点成线,由 ...
- MyEclipse安装EGit插件方法
摘要: 先了解自己的MyEclipse是基于哪个版本的Eclipse优化的,然后到EGit网站找对应的EGit版本,下载压缩包,解压安装. 在网上看到有人说并不是任意版本的EGit插件都能适配你的My ...
- How many virtual users do I need? 计算需要的vuser
基本公式:--------English:Total Transations = TPS * Vuser==>Vuser = Total Transations / TPS=========== ...
- vs2013配置opencv3.2.0
工具/原料 l VS2013 l OpenCV3.20http://jaist.dl.sourceforge.net/project/opencvlibrary/opencv-win/3.2.0/op ...
- tiny6410SDK制作NFS文件系统
1.初次编译内核出现问题 解决方法:将uboot的tools目录 下的mkimage拷贝到/bin/下. 2.开机后终端出现mmc0: error -110 whilst initialising S ...
- 赠 看穿一切的var_dump
看穿一切的var_dump同学让我送他一首诗,于是作诗如下: 看穿一切被看穿,莫让年少酿毒烟.骄心当制能补拙,拨开云雾见上仙!
- impala不能查询hive中新增加的表问题
使用Cloudera Manager部署安装的CDH和Impala,Hive中新增加的表,impala中查询不到,其原因是/etc/impala/conf下面没有hadoop和hive相关的 ...