【问题标题】:Jetty and tomcat are responding on the browser but giving a connection refused error via cURLJetty 和 tomcat 在浏览器上响应,但通过 cURL 给出连接被拒绝错误
【发布时间】:2013-08-10 03:49:59
【问题描述】:

我在 Ubuntu 机器上安装本地 solr-jetty 时遇到了一个奇怪的问题。我刚刚做了一个“sudo apt-get install solr-jetty”(它安装了 jetty 作为依赖项)。

当我在浏览器上打开 http://127.0.0.1:8080 时,我会看到“欢迎来到 debian 上的 jetty 6”页面。当我尝试:

curl http://127.0.0.1:8080

我收到一个 html,通知我 (111) Connection refused 响应。有人知道发生了什么吗?

谢谢。


编辑:

显然问题不在于码头。我删除了码头并尝试使用tomcat6,但同样的问题仍然存在。也许这台机器上有一些网络配置?

【问题讨论】:

    标签: tomcat ubuntu curl jetty


    【解决方案1】:

    查看你的 shell 中是否设置了任何环境变量,例如“http_proxy”:

    env | grep -i proxy
    

    如果是这种情况,请尝试禁用它,以在 /etc/profile.d//etc/env.d$HOME/.bashrc 中设置它。 YMMV,因为我不知道 ubuntu 把它的东西放在哪里。

    如果你需要其他东西的代理,你可以像https://serverfault.com/questions/42426/proxy-exceptions-when-using-http-proxy-env-var一样添加一个例外:

    export  no_proxy=localhost,127.0.0.0/8 #etc.
    

    【讨论】:

    • 哦该死的......是的。我在代理之下。我应该怎么办?如果我取消设置代理变量,其他一切都将停止工作。 ://
    • 编辑了答案以反映新的 cmets。
    猜你喜欢
    • 2023-03-23
    • 2016-11-19
    • 2021-05-23
    • 2015-03-26
    • 2018-09-28
    • 1970-01-01
    • 1970-01-01
    • 2016-03-15
    • 1970-01-01
    相关资源
    最近更新 更多