二维码

ssl_module加载在哪里,为什么不能绑定到端口443?

1537 人阅读 | 时间:2021年12月07日 10:17

当我尝试启动httpd时,出现以下错误:

# service httpd start || journalctl -xn..
[so:warn] [pid 425] AH01574: module ssl_module is already loaded, skipping
httpd[425]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
httpd[425]: no listening sockets available, shutting

语法可以:

# httpd -t
[so:warn] [pid 917] AH01574: module ssl_module is already loaded, skipping
Syntax OK

Ok, fine. So ssl_module.so is being loaded twice. Except that it's not:

# grep -ir ssl_module /etc/httpd/*
/etc/httpd/conf.d/ssl.conf:LoadModule ssl_module modules/mod_ssl.so

它还说在端口443上监听了一些东西。除了没有监听到:

# netstat -tulpn
Active Internet connections (only servers)Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      336/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      336/sshd

而且我在httpd配置中只听了一次:

# grep -ir 443 /etc/httpd/*
/etc/httpd/conf.d/ssl.conf:Listen 443
/etc/httpd/conf.d/ssl.conf:<VirtualHost *:443>

apache没有运行任何服务:

# top -u apache..(nothing)

由于警告和套接字已在使用中的错误,这看起来好像apache正在将其他conf加载到正在加载ssl_module.so并正在侦听端口443的某个位置。

但是问题是..它在哪里?

这来自运行CentOS Linux版本7.2.1511的VPS配置。

问题最终是httpd.conf中的重复行,导致ssl.conf被加载两次。

有一行:

Include conf.d/*.conf

然后进一步向下:

IncludeOptional conf.d/*.conf

第一个被删除,问题已解决。


导致这个问题一般都是证书的问题,建议在httpd.conf着手


©著作权归作者所有:来自ZhiKuGroup博客作者没文化的原创作品,如需转载,请注明出处,否则将追究法律责任 来源:ZhiKuGroup博客,欢迎分享。

评论专区
  • 昵 称必填
  • 邮 箱选填
  • 网 址选填
◎已有 0 人评论
搜索
作者介绍
30天热门
×
×
本站会员尊享VIP特权,现在就加入我们吧!登录注册×
»
会员登录
新用户注册
×
会员注册
已有账号登录
×