偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

從命令行使用 wget 調(diào)試網(wǎng)頁錯誤

系統(tǒng) Linux
調(diào)試 Web 服務(wù)器的一種方法是使用 wget 命令行程序,使用 -S 選項來顯示所有的服務(wù)器響應(yīng)。當(dāng)使用 wget 進行調(diào)試時,我也喜歡使用 -O 選項將輸出保存到一些臨時文件中,以備以后需要查看其內(nèi)容。

[[424697]]

調(diào)試 Web 服務(wù)器的一種方法是使用 wget 命令行程序。

有時在管理一個網(wǎng)站時,事情會被搞得一團糟。你可能會刪除一些陳舊的內(nèi)容,用重定向到其他頁面來代替。后來,在做了其他改動后,你發(fā)現(xiàn)一些網(wǎng)頁變得完全無法訪問了。你可能會在瀏覽器中看到一個錯誤:“該頁面沒有正確重定向”,并建議你檢查你的 cookie。 

Redirect loop example in Firefox

調(diào)試這種情況的一個方法是使用 wget 命令行程序,使用 -S 選項來顯示所有的服務(wù)器響應(yīng)。當(dāng)使用 wget 進行調(diào)試時,我也喜歡使用 -O 選項將輸出保存到一些臨時文件中,以備以后需要查看其內(nèi)容。

  1. $ wget -O /tmp/test.html -S http://10.0.0.11/announce/
  2. --2021-08-24 17:09:49-- http://10.0.0.11/announce/
  3. Connecting to 10.0.0.11:80... connected.
  4.  
  5. HTTP request sent, awaiting response...
  6.  
  7. HTTP/1.1 302 Found
  8. Date: Tue, 24 Aug 2021 22:09:49 GMT
  9. Server: Apache/2.4.48 (Fedora)
  10. X-Powered-By: PHP/7.4.21
  11. Location: http://10.0.0.11/assets/
  12. Content-Length: 0
  13. Keep-Alive: timeout=5, max=100
  14. Connection: Keep-Alive
  15. Content-Type: text/html; charset=UTF-8
  16. Location: http://10.0.0.11/assets/ [following]
  17. --2021-08-24 17:09:49-- http://10.0.0.11/assets/
  18. Reusing existing connection to 10.0.0.11:80.
  19.  
  20. HTTP request sent, awaiting response...
  21. HTTP/1.1 302 Found
  22. Date: Tue, 24 Aug 2021 22:09:49 GMT
  23. Server: Apache/2.4.48 (Fedora)
  24. X-Powered-By: PHP/7.4.21
  25. Location: http://10.0.0.11/announce/
  26. Content-Length: 0
  27. Keep-Alive: timeout=5, max=99
  28. Connection: Keep-Alive
  29. Content-Type: text/html; charset=UTF-8
  30. Location: http://10.0.0.11/announce/ [following]
  31. --2021-08-24 17:09:49-- http://10.0.0.11/announce/
  32. Reusing existing connection to 10.0.0.11:80.
  33. .
  34. .
  35. .
  36. 20 redirections exceeded.

我在這個輸出中省略了很多重復(fù)的內(nèi)容。通過閱讀服務(wù)器的響應(yīng),你可以看到 http://10.0.0.11/announce/ 立即重定向到 http://10.0.0.11/assets/,然后又重定向到 http://10.0.0.11/announce/。以此類推。這是一個無休止的循環(huán),wget 將在 20 次重定向后退出。但有了這些調(diào)試信息,你可以修復(fù)重定向,避免循環(huán)。 

 

責(zé)任編輯:龐桂玉 來源: Linux中國
相關(guān)推薦

2014-04-10 10:10:16

KVMDebianUbuntu

2012-02-08 16:37:36

ibmdw

2020-12-06 08:00:46

scanimage命令行Linux

2018-03-14 14:27:00

2018-06-19 16:05:27

LinuxStratis存儲

2023-08-01 13:31:18

模型Alpacaicuna

2020-10-31 08:20:39

curl命令命令行互聯(lián)網(wǎng)

2010-05-27 14:48:45

SVN命令行使用說明

2009-09-22 14:17:05

2022-06-16 14:54:53

hilog工具鴻蒙

2016-12-15 08:30:02

Linux命令

2017-03-13 08:50:35

科技新聞早報

2010-05-11 11:34:44

2019-02-13 09:20:13

Linux命令行more

2010-02-04 15:17:48

Linux wget

2019-07-15 05:50:19

Linux命令行VirtualBox版

2022-06-30 12:19:22

Linux

2019-08-27 08:00:10

OpenStack命令虛擬機

2014-06-06 10:00:56

命令行監(jiān)控Nginx Web服務(wù)

2019-01-22 13:46:01

LinuxUnix系統(tǒng)命令行
點贊
收藏

51CTO技術(shù)棧公眾號