时间: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. 洛谷 1072 Hankson 的趣味题——质因数界限讨论

    题目:https://www.luogu.org/problemnew/show/P1072 思路是把每个数质因数分解,答案对于每个质因数的次数有选择的区间,通过这个计算. 指数的限制就是上限是b1, ...

  2. ubuntu系统,关于源(source)的配置

    1. 现象:(出现的错误) 执行 sudo apt-get update, 报错:apt-get 404 Not Found Package Repository Errors 执行 sudo apt ...

  3. Storm 1.0 新特性

    Storm 1.0.0版本增加了很多新的特性,可用性以及性能也得到了很大的改善,该版本是Storm发展历程上一个里程碑式的版本,主要特点如下. 性能提升 Storm 1.0.0版本最大的亮点就是性能提 ...

  4. mysql数据库备份bat脚本

    @ECHO off TITLE databaseBackup E: REM : 源数据库: IP 端口 用户名 密码 SET DB_HOST=192.168.1.1 SET DB_PORT=3306 ...

  5. RetHad6.7离线通过.rpm安装

    必须有RetHad6.7系统的.ios镜像文件,我们需要的.rpm都在镜像的Packages里面,针对不能联网的,并且也适用与CentOS系统 1. 查看版本号 参考我的博客 https://www. ...

  6. Eclipse安装反编译插件,查看.class文件的源码

    2017-08-24 这样我们就可以通过Eclipse查看.class文件的源码了. 1.参考别人的博客,亲测有效 https://www.cnblogs.com/JealousGirl/p/setu ...

  7. ubuntu删除g2o

    解决方法为:(1)删除/usr/local/include/g2o,指令为sudo rm -rf /usr/local/include/g2o:(2)删除/usr/local/lib下有关libg2o ...

  8. Java 类加载器的作用

    深入探讨 Java 类加载器 成 富, 软件工程师, IBM 中国软件开发中心 成富任职于 IBM 中国软件开发中心,目前在 Lotus 部门从事 IBM Mashup Center 的开发工作.他毕 ...

  9. Ubuntu 下编译libjingle-0.6.14 (转载)

    转自:http://blog.csdn.net/feifei454498130/article/details/8197103 添加依赖库: sudo apt-get install build-es ...

  10. 4.1 手写Java PriorityQueue 核心源码 - 原理篇

    本章先讲解优先级队列和二叉堆的结构.下一篇代码实现 从一个需求开始 假设有这样一个需求:在一个子线程中,不停的从一个队列中取出一个任务,执行这个任务,直到这个任务处理完毕,再取出下一个任务,再执行. ...