apache - Apache 未启动:(98)地址已在使用中
问题描述
昨天我的 WordPress 网站离线显示错误ERR_CONNECTION_REFUSED
。今天我发现我的 VPS 中的 Apache 已关闭。启动 Apache,我的控制面板返回:
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2019-12-23 17:05:28 UTC; 7min ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 7728 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 7727 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 7727 (code=exited, status=1/FAILURE)
Dec 23 17:05:27 site.com systemd[1]: Starting The Apache HTTP Server...
Dec 23 17:05:28 site.com httpd[7727]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443 (hidden ip)
Dec 23 17:05:28 site.com httpd[7727]: no listening sockets available, shutting down
Dec 23 17:05:28 site.com httpd[7727]: AH00015: Unable to open logs
Dec 23 17:05:28 site.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Dec 23 17:05:28 site.com kill[7728]: kill: cannot find process ""
Dec 23 17:05:28 site.com systemd[1]: httpd.service: control process exited, code=exited status=1
Dec 23 17:05:28 site.com systemd[1]: Failed to start The Apache HTTP Server.
Dec 23 17:05:28 site.com systemd[1]: Unit httpd.service entered failed state.
Dec 23 17:05:28 site.com systemd[1]: httpd.service failed.
我试图发现端口上正在运行哪些服务,以杀死它们,但端口 80 和 443 没有被使用。
通过专门查询这些端口,它们返回:
80/tcp closed http
443/tcp closed https
即使门关闭,尝试启动 apache 服务时也会发生错误。我搜索了 Stack Overflow 的答案,尝试了所有关于这些问题的答案方法,但都没有解决问题。
我正在使用Webmin
7.7.1908CentOS
更新
解决方案
我有完全相同的问题,我打开了这个文件:
/etc/httpd/conf.d/ssl.conf
并看到了这两行:
Listen 443 https
Listen MY_IP:443
我刚刚评论了第一行,如下所示:
# Listen 443 https
Listen MY_IP:443
一切都正常了。我能够启动httpd服务。
systemctl start httpd.service
推荐阅读
- javascript - 将元素添加到容器底部并向上移动元素
- javascript - 如何仅在节点 js 和 ejs 中单击时使按钮提交值
- c++ - 如何将文件中的两个单词放入数组中的一个索引中?
- python-3.x - 在 pyspark 2.2 或 2.3 中的 groupby 上添加密集向量列
- node.js - Discord.js voiceStateUpdate 未正确注册
- python - Google OR-Tools:司机因服务规定休息时间
- wordpress - Ant Media Server 嵌入代码在 wordpress 中无法正常工作
- angular - 如何从 Angular 的集合中正确检索 FireStore 对象数组?
- javascript - 使用单选按钮突出显示表格列
- visual-studio-code - 如何使用 CMake Tools 插件配置复杂的项目?