【问题标题】:Apache 2.4.7 / Search permissionsApache 2.4.7 / 搜索权限
【发布时间】:2016-02-02 07:16:33
【问题描述】:

我正在获取当前日志:

[Mon Nov 02 11:31:37.831384 2015] [core:error] [pid 15509] (13)Permission denied: [client 127.0.0.1:55073] AH00035: access to / denied (filesystem path '/home/sharkie/NetBeansProjects') because search permissions are missing on a component of the path

在浏览器上:

Forbidden

You don't have permission to access / on this server.
Apache/2.4.7 (Ubuntu) Server at gamefriend.local Port 80

我已经测试但尚未工作的内容:

添加到 /etc/apache2/apache2.conf

<Directory /home/sharkie/NetBeansProjects/GameFriend/web/>
  Require all granted
</Directory>

命令在提示符下运行

find /home/sharkie/NetBeansProjects/ -type f -exec chmod 644 {} \;
find /home/sharkie/NetBeansProjects/ -type d -exec chmod 755 {} \;
find /var/www/ -type f -exec chmod 644 {} \;
find /var/www/ -type d -exec chmod 755 {} \;
chmod +rwx /home/sharkie/NetBeansProjects/
chmod +rwx /home/sharkie/NetBeansProjects/GameFriend
chmod +rwx /home/sharkie/NetBeansProjects/GameFriend/web

我当前在 apache2/sites-enabled 文件夹中的 Gamefriend.conf 文件

<VirtualHost *:80>
    ServerName gamefriend.local
    DocumentRoot /home/sharkie/NetBeansProjects/GameFriend/web
    DirectoryIndex app.php
    ErrorLog /var/log/apache2/gamefriend-error.log
    CustomLog /var/log/apache2/gamefriend-access.log combined
    <Directory "/home/sharkie/NetBeansProjects/GameFriend/web">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

通过以下命令查找 .htaccess 文件但未找到:

tree -if / | grep .htaccess

文件夹权限来了:

drwxr-xr-x  3 sharkie sharkie 4096 Nov  2 09:58 NetBeansProjects
Inside NetBeansProjects
drwxr-xr-x 7 sharkie sharkie 4096 Nov  2 09:58 GameFriend
Inside GameFriend
drwxr-xr-x  6 sharkie sharkie  4096 Nov  2 09:58 app
drwxr-xr-x  2 sharkie sharkie  4096 Nov  2 09:58 bin
-rw-r--r--  1 sharkie sharkie  2148 Nov  2 09:58 composer.json
-rw-r--r--  1 sharkie sharkie 61966 Nov  2 09:58 composer.lock
-rw-r--r--  1 sharkie sharkie    79 Nov  2 09:58 README.md
drwxr-xr-x  3 sharkie sharkie  4096 Nov  2 09:58 src
drwxr-xr-x 14 sharkie sharkie  4096 Nov  2 09:58 vendor
drwxr-xr-x  3 sharkie sharkie  4096 Oct 27 20:00 web

【问题讨论】:

    标签: linux apache permissions


    【解决方案1】:

    找到了一个解决方案,即使我不知道它是否安全。

    chmod +x /
    chmod +x /home/
    chmod +x /home/sharkie/
    

    任何关于让它搜索主页和用户文件夹这一事实的评论将不胜感激。

    【讨论】:

      猜你喜欢
      • 2015-06-22
      • 2015-10-15
      • 2016-10-06
      • 2015-05-02
      • 2016-12-23
      • 2014-07-16
      • 2011-08-21
      • 2019-07-22
      • 2014-06-29
      相关资源
      最近更新 更多