zoukankan      html  css  js  c++  java
  • CentOS出错You don't have permission to access on this server

    检查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


  • 相关阅读:
    windows中抓取hash小结(上)
    内网横向移动常见方法
    常见默认服务端口整理
    Kerberos认证流程简述
    SQL注入之MySQL报错注入整理
    域内常用命令整理
    一个极其朴素的目录扫描Python脚本
    5. 7冲刺记录
    5. 6冲刺记录
    梦断代码阅读笔记
  • 原文地址:https://www.cnblogs.com/moqiang02/p/4061356.html
Copyright © 2011-2022 走看看