e站顯示403解決方法有重建dns緩存、修改文件夾安全屬性等。
1、重建dns緩存
對于一些常規(guī)的403 forbidden錯誤,建議首先要嘗試的就是重建dns緩存,在運行中輸入cmd,然后輸入ipconfig/flushdns即可。如果不行的話,就需要在hosts文件里把主頁解析一下了。同時,查看是否在網(wǎng)站虛擬目錄中添加默認(rèn)文檔,一般默認(rèn)文檔為:index.html;index.asp;index.php;index.jsp;default.htm;default.asp等。
2、修改文件夾安全屬性
用以下命令修改文件夾安全屬性:
chcon-R-t httpd_user_content_t public_html/
所用命令解析:
ls-Z-d public_html/
#顯示文件/目錄的安全語境-Z,--context
Display security context so it fits on most displays.Displays only mode,user,group,security context and file name.-d,--directory
list directory entries instead of contents,and do not dereference symbolic links
chcon-R-t httpd_user_content_t public_html/
#修改文件/目錄的安全語境-R,--recursive
change files and directories recursively-t,--type
set type TYPE in the target security context
403錯誤代碼的分類介紹:
1、403.1
403.1錯誤是由于“執(zhí)行”訪問被禁止而造成的,若試圖從目錄中執(zhí)行CGI、ISAPI或其他可執(zhí)行程序,但該目錄不允許執(zhí)行程序時便會出現(xiàn)此種錯誤。
2、403.2
403.2錯誤是由于“讀取”訪問被禁止而造成的。導(dǎo)致此錯誤是由于沒有可用的默認(rèn)網(wǎng)頁并且沒有對目錄啟用目錄瀏覽,或者要顯示的HTML網(wǎng)頁所駐留的目錄僅標(biāo)記為“可執(zhí)行”或“腳本”權(quán)限。
3、403.3
403.3錯誤是由于“寫入”訪問被禁止而造成的,當(dāng)試圖將文件上載到目錄或在目錄中修改文件,但該目錄不允許“寫”訪問時就會出現(xiàn)此種錯誤。