我最近安装了启用openssl 1.0.2j的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身份运行 - 这会是问题吗?