Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Centos apache Web服务器抛出403错误_Linux_Apache_Centos_Webserver - Fatal编程技术网

Linux Centos apache Web服务器抛出403错误

Linux Centos apache Web服务器抛出403错误,linux,apache,centos,webserver,Linux,Apache,Centos,Webserver,我只是想学习CentOS并在其上安装apache服务器。但是当我在本地ip上尝试curl时,我得到了403错误。Intens用户有sudo用户 仅使用此用户安装apache服务器。我不知道如何给我运行Web服务器的权限 [Inten@localhost ~]$ hostname -I | awk '{print $1}' 10.0.2.15 [Intens@localhost ~]$ curl 10.0.2.15:80 <!DOCTYPE HTML PUBLIC "-//IETF/

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

仅使用此用户安装apache服务器。我不知道如何给我运行Web服务器的权限

    [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>

检查/var/www/html上是否有可用的文件

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

  • 我将/html目录的权限更改为0775
    [Intens@localhost~]$ls-ld/var/www/html/drwxrwxr-x。2 root root 10月6日7:17:44/var/www/html/
    。我正在尝试将index.html文件保存在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/