dongmao3131 2018-06-27 08:51
浏览 175

尝试访问Apache上的文件时权限被拒绝

I try to run very basic php app using apache and docker compose and have a problem with apache settings. When I try to access any static file in subdirectory I get lack of permissions. PHP calls seem to work fine.

So:

  • when I try to request localhost/LICENSE.txt I get the license.
  • when I try to access localhost/test.php or localhost/app/test.php it works fine
  • when I try to access localhost/app/test.html I get Forbiddenin the browser andclient denied by server configuration: /var/www/localhost/htdocs/src/app/test.html` in error log

Of course files I try to request are in the right locations.

Here's apache version I am trying to run:

/var/www/localhost/htdocs # httpd -v
Server version: Apache/2.4.33 (Unix)
Server built:   Mar 27 2018 11:32:10

Here's my host config:

<VirtualHost *:80>
    ServerAdmin test@example.com
    DocumentRoot /var/www/localhost/htdocs/src
    ServerName schmidt.local

    <Directory "/var/www/localhost/htdocs/src">
        #
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   AllowOverride FileInfo AuthConfig Limit
        #
        AllowOverride All
        #
        # Controls who can get stuff from this server.
        #
        Require all granted
        RewriteEngine On

    </Directory>
    <LocationMatch "^/(.*\.php(/.*)?)$">
        ProxyPass fcgi://php-fpm:7000/var/www/localhost/htdocs/src/$1
    </LocationMatch>

</VirtualHost>

So as you can see I already have request instead of allow as suggested here.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)