【发布时间】:2017-05-17 22:38:54
【问题描述】:
我最近使用 openssl 1.0.2j 安装了启用 SSL 的 Apache 2.4.20。
更新 httpd.conf 和 httpd-ssl.conf 文件并尝试在侦听端口 443 时启动 Apache,我收到以下错误:
(13)Permission denied: -----: make_sock: could not bind to address [::]:443
(13)Permission denied: -----: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
这是我的配置:
httpd.conf:
Listen 51000
#Listen 443
#Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf
httpd-ssl.conf
Listen 443
如果我在 httpd-ssl.conf 文件中注释掉这一行,我的 apache 就可以正常启动:
attempting to start apache
done
但是,我每次都会收到套接字错误。
我以 root 身份运行以下命令:
netstat -tlpn | grep :443
什么都没返回。
lsof -i tcp:443
什么都没返回。
我在某处读到只有 root 可以绑定到低于 1024 的地址,但我不知道该声明的有效性。 Apache 没有以 root 身份运行 - 这会是问题吗?
【问题讨论】:
-
我也有同样的问题。如果您实际上无法指定要侦听的 HTTPS 端口和 IP 地址,甚至在 ssl.conf 中有一个 Listen 选项似乎有点愚蠢。奇怪的是,在我的情况下,如果我注释掉 Listen 选项,那么 Apache 无论如何都会默认侦听 *:443,而不是特定的 IP 地址。