Apache正常启动,访问本地站点提示禁止访问,Error 403

配置网站后访问出现以下提示

禁止访问!

​ 您无权访问所请求的目录。 这是由于没有主页或该目录不允许被读取导致的。

如果您认为这是一个服务器错误,请联系网站管理员

Error 403

localhost
Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.2.29

  • 解决方案

    1. 查看文件权限

    2. 修改Apache配置文件httpd.conf中关于目录访问权限设置

      #
      # Deny access to the entirety of your server's filesystem. You must
      # explicitly permit access to web content directories in other 
      # <Directory> blocks below.
      #
      <Directory />
          AllowOverride none
          Require all denied
      </Directory>
      
      #增加自定义项
      <Directory "F:/">
          AllowOverride All
          Require all granted
      </Directory>
      
    3. 如果仍未解决还需关闭selinux,重启生效

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章