小编max*_*018的帖子

Apache 服务器中特定目录出现 403/404 错误

我在 Ubuntu 18.10 中运行 Apache Server 2.4.34。我无法弄清楚为什么我无法从服务器根目录 (/var/www/http/) 的图标/目录访问资源。文件给出 404,目录给出 403 禁止

该服务器是新设置的,所有文件/目录均归 www-data 所有。我有其他目录(例如 images/),它们具有相同的权限(目录为 771,文件为 644),我可以访问其中的索引及其所有文件。

我已经搜索了很多,我可以找到很多关于无法访问子文件夹的内容,但不是关于与其他文件夹具有相同设置的特定文件夹。如果有的话,这个文件夹应该有更宽松的权限,因为我已经在我的 apache2.conf 文件中添加了有关它的特定部分。

下面是我的 apache2.conf 和 default.conf 文件,减去apache2.conf顶部的一些注释内容

DefaultRuntimeDir ${APACHE_RUN_DIR}

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or …
Run Code Online (Sandbox Code Playgroud)

apache webserver

2
推荐指数
1
解决办法
2472
查看次数

标签 统计

apache ×1

webserver ×1