? 人妻少妇精品专区性色av,人人爱夜夜爽日日做视频,国产成人精品一区二区秒播

全國銷售熱線:020-22275526 22274250

服務(wù)中心
常見問題
Apache服務(wù)器設(shè)置403,404,500錯誤頁
發(fā)布日期:2014-12-20        作者:凱易通軟件

 

Apache服務(wù)器設(shè)置404錯誤頁


這樣做的好處一個是很友好,另一個是對于你的網(wǎng)站會更安全些,如果沒設(shè)置,別人在你的網(wǎng)址后隨便輸入一個路徑,會顯示404錯誤,并且會顯示你的服務(wù)器版本號,服務(wù)器配置一目了然,為了避免這種情況,可以設(shè)置錯誤頁面。
當出現(xiàn)404錯誤,即找不到網(wǎng)頁時,把訪問者導入到一個事先定義好的錯誤頁面。
修改 httpd.conf
找到:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 xxxxxxx
httpd.conf中的這一部分,#ErrorDocument 404 /missing.html 是顯示錯誤頁信息的,去掉前面的#
修改為 ErrorDocument 404 /error.htm,
其中error.htm為站點根目錄下和error目錄下的一個錯誤文件,需要你自己建立。當發(fā)生404錯誤時,進入error.htm頁面,可以提示網(wǎng)頁沒有找到。這樣就不可能看到你的服務(wù)器軟件信息了。也可以設(shè)置其它的錯誤導向的頁面,具體http響應(yīng)錯誤編號請查閱相關(guān)資料。
重新啟動apache,如果沒意外,此時已經(jīng)安裝成功,把靜態(tài)頁面放到站點根目錄和error目錄下,看能不能成功解析。隨便輸入一個:http://localhost/abcd.htm,看是不是導向你設(shè)置的404錯誤,即error.htm錯誤頁面.! 
 
百度到這個方法,配置好重啟apache之后發(fā)現(xiàn)不行。。。
找了半天看到Include "conf/extra/httpd-multilang-errordoc.conf"這種類似的語句。
在conf/extra/httpd-multilang-errordoc.conf文件里面發(fā)現(xiàn)了
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
ErrorDocument 404 /404error.html
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
ErrorDocument 410 /error/HTTP_GONE.html.var
ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
原來是被覆蓋掉了
在這里改掉之后重啟apache之后就OK了。。。。

網(wǎng)友評論
用戶姓名:
評論內(nèi)容:
驗證碼:      看不清楚,換一張
         
  • 在線客服
    點擊圖標咨詢

  • 服務(wù)熱線:
    400-8788-609
    020-22275526
  • 客服QQ
    1239396386
    2219944045