时间:2014-10-13 17:34来源:有何不可 作者:有何不可 举报 点击:56151次

项目部署到Apache Http Server上面,通过apachectl -t 检测配置文件也没有问题。可是通过浏览器访问,却出现了“you don't have permission to access / on this server”.

项目部署到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文件中所指定的用户没有访问项目所在目录的权限。

you don't have permission to access / on this server解决的更多相关文章

  1. phpstudy 产生You don't have permission to access / on this server.解决

    phpstudy配置好访问目录时候有时候会产生You don't have permission to access / on this server. 解决办法: 修改服务器httpd.conf配置 ...

  2. Apache提示You don't have permission to access / on this server 解决

    本文链接:https://blog.csdn.net/Niu_Eva/article/details/90741894 Apache提示You don’t have permission to acc ...

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

  4. phpstudy无法访问主页,提示You don't have permission to access / on this server解决办法

    1.输入localhost提示:You don't have permission to access / on this server. 新版phpStudy为了安全,取消Apache和nginx列 ...

  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. mac osx Forbidden You don't have permission to access / on this server解决方法

    (1)首先查看*.conf 是否有读写权限,如果没有要将文件赋予读写权限,比如 localhost.conf (2)再查看/Users/username/Sites/localhost/文件夹是否有i ...

  7. localhost访问错误Forbidden You don't have permission to access / on this server.解决办法(亲测)

    在httpd.conf文件下找到这段: <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow D ...

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

  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. SNMP:简单网络管理协议

    基于 TCP/IP 的网络管理包括两部分:网络管理站 (manager) 和被管理的网络单元(被管设备).这些被管设备的共同点就是都运行 TCP/IP 协议.管理进程和代理进程之间的通信有两种方式,一 ...

  2. springboot开启远程调试

    远程调试maven设置 The run goal forks a process for the boot application. It is possible to specify jvm arg ...

  3. bzoj1319

    数论 这个幂指数很难搞,那么我们取个log 去取log得有底数,那么自然这个底数能表示出所有的数 原根满足这个性质 那么我们求出原根,再去log 变成k*ind(x)=ind(a) (mod phi( ...

  4. Android开发--数据存储之数据库操作

    简介: SQLite 的介绍: SQLite数据库属于文本型的数据库,它是以文本的形式来保存的.Android提供了对 SQLite 数据库的完全支持,应用程序中的任何类都可以通过名称来访问任何的数据 ...

  5. Codeforces Round #408( Div2)

    Bank Hacking 阅读题,读完之后手算一下可以发现每一个bank被hack所需要的strength无非分为三种情况. 1. $a_i$,当且仅当i为第一个选择的点. 2. $a_i+1$,当且 ...

  6. 1.18-1.21 Oozie Coordinator调度

    一.时区问题 1.修改系统时区 ## [root@hadoop-senior hadoop-2.5.0-cdh5.3.6]# rm -rf /etc/localtime [root@hadoop-se ...

  7. httpServlet,GenericServlet,Servlet源码分析

    httpServlet源码:   /* * Licensed to the Apache Software Foundation (ASF) under one or more * contribut ...

  8. QDUOJ 分辣条-01背包恰好装满情况

    分辣条 发布时间: 2016年6月26日 20:36   最后更新: 2016年6月26日 20:37   时间限制: 1000ms   内存限制: 128M 描述 “你喝的酸奶是我买的,辣条也是我买 ...

  9. window.showModalDialog 在谷歌Uncaught TypeError: undefined is not a function

    if(navigator.userAgent.indexOf("Chrome") >0 ){var winOption = "height="+heigh ...

  10. Servlet | 访问不同格式文件(PDF、doc)

    核心代码 //设置响应内容类型为PDF类型 response.setContentType("application/pdf"); request.getRequestDispat ...