linux - Centos apache Web 服务器抛出 403 错误

标签 linux apache centos webserver

我只是想学习CentOS并在其上安装apache服务器。但是当我在本地 IP 上尝试 curl 时,我收到 403 错误。 Intens 用户拥有 sudo 用户。

仅使用此用户安装 apache 服务器。我不知道如何授予我运行网络服务器的权限。

    [Inten@localhost ~]$ hostname -I | awk '{print $1}'
10.0.2.15
[Intens@localhost ~]$ curl 10.0.2.15:80
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /
on this server.<br />
</p>
<p>Additionally, a 403 Forbidden
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>

文件夹的权限

[Intens@localhost ~]$ ls -ld /etc/httpd/
drwxr-xr-x. 5 root root 105 Oct 22 23:40 /etc/httpd/
[Intensify@localhost ~]$ ls -ld /var/www/
drwxr-xr-x. 4 root root 33 Oct 22 23:40 /var/www/

最佳答案

检查/var/www/html 上是否有任何可用文件。

  1. 在centos中,apache的文档目录结构为/var/www/html。
  2. 尝试将/var/www/html的权限更改为0775。
  3. 检查 index.html 文件是否位于 httpd 服务器文档路径中的/var/www 或/var/www/html 内。

关于linux - Centos apache Web 服务器抛出 403 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58515403/

相关文章:

android - 在 Linux 机器中哪里可以找到 adb_usb.ini

apache - 自定义 apache tomcat 身份验证所需的弹出窗口

Jenkins 挂断: Please wait while Jenkins is getting ready to work

使用nohup时python脚本无法工作

centos - rpm -i 表示已安装,但 rpm -e 表示未安装

java - 内存中的文件是否与文件系统中的文件大小相同?

linux - 在不重新启动浏览器的情况下从可执行文件安装外部 Chrome 扩展

linux - 在运行 Linux 的 EC2 上启动时启动 http、mysql、ftp 和 cronjobs?

php - 使用 htaccess 删除尾部斜杠

linux - AT91(Cortex A5 ARM,无GPU)3D图形应用程序开发解决方案