最近,我使用OpenSS1.0.2j安装了带有SSL的Apache2.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.confhttpd-ssl.conf
Listen 443如果我在httpd-ssl.conf文件中注释掉了这一行,那么我的apache就可以正常启动:
attempting to start apache
done但是,每次使用它,我都会得到套接字错误。
我以root用户的身份运行了以下命令:
netstat -tlpn | grep :443什么也没回。
lsof -i tcp:443什么也没回。
我在某个地方读到,只有根可以绑定到1024以下的地址,但我不知道该语句的有效性。Apache不是作为root在这里运行的--这就是问题所在吗?
发布于 2017-01-03 18:48:21
发布于 2020-06-02 12:47:00
如果你用的是对接-合成,
当我们使用一个非根容器(如bitnami官方图像)时,就会发生这种情况。
我们使用用户:根和network_mode: host,当它需要与主机网络绑定时。
apache:
image: bitnami/apache:2.4
container_name: "apache"
ports:
- 80:80
network_mode: host
privileged: true
user: root
environment:
DOCKER_HOST: "unix:///var/run/docker.sock"
env_file:
- .env
volumes:
- ./setup/apache/httpd.conf:/opt/bitnami/apache/conf/httpd.conf希望能帮上忙!
https://stackoverflow.com/questions/41450260
复制相似问题