linux - 绑定(bind) Monit 使用端口 443

标签 linux ubuntu https monit

我使用 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

最佳答案

如果端口 443 已被 Apache 使用,则无法监听。

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

如果您不想键入带有端口的域,也可以。你应该看看 Apache 的 mod_proxy:https://httpd.apache.org/docs/trunk/mod/mod_proxy.html

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

关于linux - 绑定(bind) Monit 使用端口 443,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50052046/

相关文章:

c++ - gcc 和 g++ 库搜索路径

sql - 哪个 SQL 服务器在 Linux Box 上运行?

linux - 通过 bash 脚本根据其文件夹名称重命名具有 .jpg 扩展名的文件

linux - 欺骗 TCP 服务器握手失败

php - Imagemagick 与 imagick 的关系是什么?

django - celery 执行计划任务一百次

ubuntu gitkraken 无法访问 var

python - AppEngine HTTPS CName 似乎挂起

c++ - openssl SSL_get_verify_result 返回错误 20

security - 带有证书固定的移动应用程序 - DMZ 框上的 SSL 证书与受信任的 CA 对比我自己的 CA