项目部署到Apache Http Server上面,通过apachectl -t 检测配置文件也没有问题。可是通过浏览器访问,却出现了“you don't have permission to access / on this server”.
1、首先,查看conf.d/python.conf文件
<Directory "项目路径">
Options Indexes FollowSymLinks +Includes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
上面标红部分,表示允许任何人访问目录
2、其次,既然配置文件没有问题,那就需要考虑http.conf文件中指定的用户和组的访问权限。在Apache的wiki上有关于PermissionDenied的解决方法,链接是http://wiki.apache.org/httpd/13PermissionDenied,译文如下:
Error 13 指的是文件系统的访问权限错误。也就是由于错误的权限,apache被拒绝访问。一般的来说,这并不意味着是Apache配置文件存在错误。
为了给文件提供服务,Apache必须有适当的权限去访问那些文件,这些权限是由操作系统授予的。特别是在httpd.conf文件中指定User或者Group必须能够读取所有被服务的文件,以及查找包含那些文件的目录和所有的父目录直至文件系统的根。
一个类unix操作系统上不属于httpd.conf文件中指定的User或Group的资源的典型访问权限,对于普通的文件是644 -rw-r--r--,对于文件夹或者CGI脚本是755 drwxr-x-r-x。你也可能需要去查看操作系统所支持的扩展的访问权限(例如SELinux访问权限).
例子
当访问类unix操作系统上的/usr/local/apache2/htdocs/foo/bar.htm文件时,你收到了Permission Denied的错误。
首先,查看文件的访问权限:
$ cd /usr/local/apache2/htdocs/foo
$ ls -l bar.htm
如果须要的话,就修复它们:
$ chmod 644 bar.html
对文件夹以及每个父文件夹做相同的操作(/usr/local/apache2/htdocs/foo,/usr/local/apache2/htdocs,/usr/local/apache2,/usr/local/,/usr):
$ ls -la
$ chmod +x
$ cd ..
$ #repeat up to the root
在一些系统上,可使用工具namei来列出各个路径上的不同组件的访问权限,然后去发现是否有权限问题:
$ namei -m /usr/local/apache2/htdocs/foo/bar.html
3、最后,如果还是没有解决问题,那么需要查看扩展的访问权限。
使用setenforce 0关闭SELinux,看是否解决问题。
我遇到的问题是http.conf文件中所指定的用户没有访问项目所在目录的权限。
分享到:
相关推荐
Apache You don't have permission to access / on this server是一个在配置Apache时候,常常遇到的问题
主要介绍了WampServer设置apache伪静态出现404 not found及You don't have permission to access / on this server解决方法,较为详细的分析了几种常见情况,非常具有实用价值,需要的朋友可以参考下
本文实例讲述了WampServer设置apache伪静态出现404 not found及You don’t have permission to access / on this server解决方法。分享给大家供大家参考。具体如下: 出现404 not found 时: 确保LoadModule rewrite_...
主要介绍了apache You don't have permission to access /test.php on this server解决方法,需要的朋友可以参考下
键字: Apache 403 Forbidden 系统配置: 操作系统:Red Hat Linux 6.2 Web服务器:Apache 3.1.1+jakarta-tomcat 3.1.1 数据库服务器:oracle 8i Apache服务器是目前应用... You don’t have permission to access
Forbidden You don't have permission to access / on this server.
You don't have permission to access / on this server. 更改D:\Installsoftware\apache\apache\httpd-2.2-x64\conf文件夹中的httpd.conf文件中 <Directory /> Options FollowSymLinks AllowOverride None ...
本地搭建wamp,输入http://127.0.0.1访问正常,当输入http://localhost/,apache出现You don't have permission to access/on this server.的提示,如何解决? 解决方法:...
一直在用APMServ5.2.6,mysql好办,可以用mariadb代替进行升级,但php...You don't have permission to access / on this server. Apache/2.4.9 (Win32) PHP/5.5.12 Server at www.sitename.com Port 80 一、在国内网
今天调试一个项目,项目放在webroot下面的javascript目录,无论怎么设置都是403 You don’t have permission to access /javascript/ on this server. 思考过程 首先第一反应,Google了错误You don't have ...
You don’t have permission to access /repertory/on this server. 意思是:您没有访问此服务器上的权限。 我就纳闷了,检查了好久最后查看配置文件vhosts.conf文件 发现2018版配置变了 只能乖乖的按照默认格式...
set the controls width, disable image uploading and deleting, restrict access to the source/preview tabs, hide buttons and lists that you don't want your clients to see or access. <br/> <br/> 支持...
option to restore this directory tree or you will have problems because the files would not be in their proper subdirectories. Please note most of these directories are differently named to ICS V7 ...
SCGCQ00341724 Defect FW allows a firmware to be flashed through Online FW Update method in DOS and then breaks into montask SCGCQ00342848 Defect Add Adapter restart support in CLI SCGCQ00342993 Defect...
4.11 Setting a Bookmark to Return to Later . . . . . . . . . . . . . . . . . . . . . 4.11.1 A Non-obvious Benefit of Using Checkpoints . . . . . . . . . . . . 5 25 26 28 28 29 29 30 31 31 34 36 37 ...