You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Apache自动生成目录列表时遭遇403权限拒绝问题排查求助

Apache自动生成目录列表时遭遇403权限拒绝问题排查求助

各位大佬,我碰到一个按理说应该很容易解决的问题,但现在卡壳了:我的站点里都是静态HTML和PDF文件,想让Apache自动生成目录列表供访问,但每次访问都返回HTTP 403错误。

错误日志里的内容是这样的:

AH01276: Cannot serve directory /var/www/html/my-website/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive

我查了目标目录的权限,ls -l输出如下:

drwxr-xr-x. 18 root root 4096 Jul  5 10:06 /var/www/html/my-website

getfacl的输出是:

getfacl: Removing leading '/' from absolute path names

# file: var/www/html/my-website

# owner: root

# group: root

user::rwx

group::r-x

other::r-x

这是我精简后的虚拟主机配置(只保留了相关部分):

<VirtualHost 192.168.1.2:80>
    ServerName my-website.local
    AddDefaultCharset iso-8859-1
    DirectoryIndex index.php index.html index.htm
    Alias / /var/www/html/my-website/
    DocumentRoot /var/www/html/my-website/

    <Directory /var/www/html/my-website/>
        AllowOverride none
        Options +Indexes
    </Directory>
</VirtualHost>

我看目录已经设置了o+rx权限,按道理应该能被正常读取,有没有大佬能帮我看看还有什么遗漏的点?

备注:内容来源于stack exchange,提问作者rexkogitans

火山引擎 最新活动