检查http.conf发现没错之后。查找资料后发现时selinux的问题,所以须要关闭这个服务:

1 vi /etc/sysconfig/selinux
2 SELINUX=enforcing
改为 SELINUX=disabled

重新启动后生效

不需重新启动 运行命令:

1 setenforce
0

*********************************************************

在CentOS5.3+MySQL 5.0.45 +Apache2.2.3 +PHP5.1.6中执行PHP程序出错



You don't have permission to access / on this server



装好apache+php+mysql后。

拷贝一份phpmyadmin过后执行出错:

You don't have permission to access / on this server



有人说把selinux关掉就好了



而我发现了这个原因和方法:

由于站点运行的权限,一般要Read from all httpd scripts and the daemon这个权限。



当系统内经过解压出来的目录是没有这个权限的。



我们要在html/下新建一个文件夹(这时会自己主动分为Read from all httpd scripts and the daemon权限)



然后把档案复制一份过来放进去(注意不是剪切)



执行试试看吧。



我就能够了。

CentOS5.3+MySQL 5.0.45 +Apache2.2.3 +PHP5.1.6(都是系统自带的)


*********************************************************

在终端输入   (更改站点根文件夹权限为755,非常多centos系统默觉得700)

[root@localhost ~]#   chmod  -R 755 /var/www/html/

然后重新启动

[root@localhost ~]#   /etc/init.d/httpd restart

*********************************************************

打开apache的配置文件httpd.conf。逐行检查。在大约快一半的地方有下面这段代码:



    Options FollowSymLinks

    AllowOverride None

    Order deny,allow

    Deny from all


发现了吧。因为配置了php后,这里的“Deny from all”已经拒绝了一切连接。把该行改成“allow from all”,改动后的代码例如以下。问题解决。

Options FollowSymLinks

    AllowOverride None

    Order deny,allow

    allow from all



系统是centos。You don't have permission to access / on this server.

在google上搜索了一下,大部分的解决方法就是。

 

    Options FollowSymLinks

    AllowOverride None

    Order deny,allow

    Deny from all



这里改成



   Options
Indexes FollowSymLinks

    AllowOverride None



我改了之后还是会出现上面的错误,于是看一下自己设定的工作文件夹权限。

Options ExecCGI Includes

改成以下这行设置后,显示正常。

Options Indexes FollowSymLinks

当訪问类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



CentOS出错You don't have permission to access on this server的更多相关文章

  1. Linux Centos7 Apache 訪问 You don't have permission to access / on this server.

    折腾了非常久,今天才找到了最正确的答案.感言真不easy. 百度出来的99%都是採集的内容.全都是错误的. You don't have permission to access / on this ...

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

  3. You don't have permission to access ××× on this server.

    之前开发项目一直在linux上用的xampp集成环境,前几天突然想移到window上面去. 開始在window上安装了一个集成环境(名字大概是 Uniform Service),把项目文件已过去, o ...

  4. php多站点配置以及Forbidden You don't have permission to access / on this server问题解决

    php多站点配置以及Forbidden You don't have permission to access / on this server问题解决 一.总结 一句话总结:我的问题是php的版本问 ...

  5. Forbidden You don't have permission to access / on this server PHP

    在新安装的谷歌游览器里,打不了PHP网站了,错误显示: Forbidden You don't have permission to access / on this server. 原因还是配置权限 ...

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

  7. yii安装 /You don't have permission to access on this server

    在安装yii的时候 ,当打开了init.bat进行配置的时候小黑本弹出了个小黑框立刻就关闭了,  进入cmd模式再打开init.bat就出现了"You don't have permissi ...

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

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

随机推荐

  1. 解决macOS升级之后每次使用ssh都要输入密码的问题

      最近想趁着假期把跟了我2年mac的系统重做下.于是就开始行动了,经过大半天的数据备份.然后进行了全盘格式化,使用了在线更新的方式从新安装升级到了10.12.6.这里提醒下有类似的想法的同学可以采用 ...

  2. 安卓5.0新特性之Palette

    根据图片来决定标题的颜色和标题栏的背景色,这样视觉上更具有冲击力和新鲜感,而不像统一色调那样呆板. Palette这个类能提取以下突出的颜色: Vibrant(充满活力的) Vibrant dark( ...

  3. python 生成器函数.推导式.生成器表达式

    一.生成器 什么是生成器,生成器的实质就是迭代器 在python中有三种方式来获取生成器: 1.通过生成器函数 2.通过各种推导式来实现生成器 3.通过数据的转换也可以获取生成器 1 def func ...

  4. .net framework 3.5 安装报错 0x800F0954问题

    windows Server 2019 .net framework 3.5 安装报错 0x800F0954问题 .net framework 3.5的安装教程:但是安装出现0x800F0954这个错 ...

  5. 网上流行的学生选课相关的50个常用sql语句

    学生表 Student(S#,Sname,Sage,Ssex) 教师表 Teacher(T#,Tname) 课程表 Course(C#,Cname,T#) 学生成绩表 SC(S#,C#,score) ...

  6. PHP开发之旅-表单验证

    一.创建表单 <form name = "login" method = "post" action="contact.php?action=l ...

  7. JS——tab切换

    排它思想: 1.先让所有的元素恢复默认值 2.再让选中的元素赋专有的值 3.干掉所有人,剩下我一个 <!DOCTYPE html> <html> <head lang=& ...

  8. 2016.01.07 DOM笔记(二) DOM节点

    node节点属性 nodeName属性 oneBox= document.getElementsById('box');var s = oneBox.nodeName;  //nodeName与tag ...

  9. (转)postgis常用函数介绍(二)

    http://blog.csdn.net/gisshixisheng/article/details/47903151 概述: 书接上文,本文继续讲解Postgres中常用的空间函数的使用. 常用函数 ...

  10. lldb e、@weakify(self) 网络请求400错误

    lldb的问题属于调试器: 下面命令用于在调试时设值 e self.apiModel.apiParams = [NSDictionary dictionaryWithObjectsAndKeys:@& ...