【问题标题】:wget works from one ubuntu server but not anotherwget 在一个 ubuntu 服务器上工作,但不是另一个
【发布时间】:2015-11-13 23:46:36
【问题描述】:

我正在使用的命令:wget www.fivestarmazda.com/index.htm 在数字海洋托管的 ubuntu 14.10 机器上工作 在chrome浏览器中工作 不适用于机架空间托管的 ubuntu 13.10 环境。 在那里,我不断收到 403 Forbidden 错误。你们有什么想法吗?在所有环境中,我都能得到http://www.google.com

来自 wget 的完整调试消息:

DEBUG output created by Wget 1.14 on linux-gnu.

URI encoding = ‘UTF-8’
--2015-03-11 10:14:36--  http://www.fivestarmazda.com/index.htm
Resolving www.fivestarmazda.com (www.fivestarmazda.com)... 23.64.122.224
Caching www.fivestarmazda.com => 23.64.122.224
Connecting to www.fivestarmazda.com (www.fivestarmazda.com)|23.64.122.224|:80... connected.
Created socket 3.
Releasing 0x0000000001eea330 (new refcount 1).

---request begin---
GET /index.htm HTTP/1.1
User-Agent: Wget/1.14 (linux-gnu)
Accept: */*
Host: www.fivestarmazda.com
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... 
---response begin---
HTTP/1.1 403 Forbidden
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 964
X-DDC-Arch-Trace: ,HttpResponse
Date: Wed, 11 Mar 2015 14:14:46 GMT
Connection: keep-alive

---response end---
403 Forbidden
Registered socket 3 for persistent reuse.
URI content encoding = ‘utf-8’
Skipping 964 bytes of body: [<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} Skipping 452 bytes of body: [P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 403 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>Access to the specified resource () has been forbidden.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>] done.
2015-03-11 10:14:36 ERROR 403: Forbidden.

【问题讨论】:

  • 这个问题最好在askubuntu.comunix.stackexchange.com 中提出,stackoverflow 仅用于编程问题
  • 感谢您的评论,我现在在 askubuntu.com 上提出了同样的问题:askubuntu.com/questions/595548/…
  • 这是wget的一个bug,试试curl吧。
  • 我得到相同的 403 禁止使用 curl。我联系了 rackspace,他们建议我在另一个数据中心设置另一台服务器。我这样做了,并且 wget 对于上述所有示例都可以正常工作。我能看到的唯一区别是这个新服务器托管在弗吉尼亚州,而另一个托管在芝加哥。在芝加哥托管了其他几台服务器,rackspace 尝试使用这些服务器,但无法让 wget 为 www.fivestarmazda.com/index.htm 工作

标签: ubuntu wget http-status-code-403


【解决方案1】:

我遇到了类似的问题。原因是一方面设置了环境变量“http_proxy”。由于 wget 没有关于如何通过代理的信息,因此访问失败。

【讨论】:

    猜你喜欢
    • 2015-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多