更改虚拟目录权限时,来自Apache Web服务器的CentOS / Linux权限错误

时间:2013-09-17 10:09:01

标签: php linux apache permissions centos

我需要在自我托管的CentOS VPS上创建SSH帐户。我希望他们只能访问自己的主目录。我想避免使用CHRoot监狱来保持简单。我希望用linux文件权限来实现这一点。

到目前为止我做了什么:

  1. 我使用以下内容备份了现有权限:getfacl -R /> permissions.acl
  2. 我运行的操作会删除所有世界/其他用户访问权限。 chmod -R o-rx /(以递归方式修改root权限,删除其他/ world组上的读取和执行。
  3. 测试现有网站:
  4. 对不起,因为我是新手并没有声誉而无法发布图片

    Forbidden
    
    You don't have permission to access /index.htm on this server.
    
    Apache/2.2.15 (CentOS) mod_fcgid/2.3.7 PHP/5.3.3 mod_python/3.3.1 Python/2.6.6 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_perl/2.0.4 Perl/v5.10.1 Server at www.ponmanconstructions.com Port 80
    
    1. 恢复已知的工作配置。
    2. 知道为什么会这样吗?

      带有工作配置的文件夹中的ls -l <​​/ p>

      drwxrwxr-x  6 apache    root 4096 Jul 22 07:28 mysite.com
      

      所需配置文件夹中的ls -l(此配置导致Forbidden错误)

      drwxrwx---  6 apache    root 4096 Jul 22 07:28 mysite.com
      

1 个答案:

答案 0 :(得分:0)

apache用户也属于apache组,如果你不提供read&amp;执行该组的权限,以便成为其他人,即为什么你得到禁止的错误。

谢谢&amp;问候,
Alok Thaker

相关问题