【问题标题】:Bind Monit to use Port 443 [closed]绑定 Monit 以使用端口 443 [关闭]
【发布时间】:2018-10-07 16:30:42
【问题描述】:

我正在使用带有此配置的 Monit:

set httpd port 2812
    allow 0.0.0.0/0.0.0.0
    allow md5 /etc/apache2/.htpasswd USERX
    ssl enable
    pemfile /etc/monit/pemfile-DOMAIN.pem

我无法将端口更改为 443 或 80,但 我只想在 443 上使用 https。 如果我尝试,我会收到此错误:

[CEST Apr 26 23:08:33] error    : Cannot listen -- Address already in use
[CEST Apr 26 23:08:33] error    : HTTP server: not available -- could not create a server socket at port 443 -- Address already in use

【问题讨论】:

  • 错误似乎很清楚?正在使用的地址?
  • 是的,因为你是对的,但 Apache 将始终监听 443(我有一些其他域正在运行)。好像没有办法在 443 上运行?
  • 不要监听 443 端口。只要监听其他空闲端口即可。你为什么要在那个端口上呢?
  • 我不想在输入 URL 时添加端口。我只想使用monit.domain.com。但我认为我看到了 Apache 的问题。
  • Stack Overflow 是一个编程和开发问题的网站。这个问题似乎离题了,因为它与编程或开发无关。请参阅帮助中心的What topics can I ask about here。也许Super UserUnix & Linux Stack Exchange 会是一个更好的提问地点。

标签: linux ubuntu https monit


【解决方案1】:

如果 Apache 已使用端口 443,则您无法侦听。

您应该将 Monit 绑定到另一个端口(例如 8443)。

如果您不想使用端口键入域,那很好。你应该看看 Apache 的 mod_proxy:https://httpd.apache.org/docs/trunk/mod/mod_proxy.html

基本上,让 Apache 在端口 443 上侦听 monit.example.com,并将这些请求转发到端口 8443(Monit 实际运行的地方)上的 localhost。

【讨论】:

  • 我会的。谢谢。
猜你喜欢
  • 2017-08-28
  • 1970-01-01
  • 2017-05-17
  • 1970-01-01
  • 2019-02-28
  • 1970-01-01
  • 2022-01-11
  • 2023-03-09
  • 1970-01-01
相关资源
最近更新 更多