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,重啓生效

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