在 Ubuntu 上尝试禁用 Apache 中的 SSL。但当我重新启动 Apache 时,它失败了...
a2dismod ssl
结果:
Module ssl disabled. To activate the new configuration, you need to run: systemctl restart apache2
systemctl 重新启动 apache2
结果:
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xeu apache2.service"
apache2日志:
× apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2024-02-06 15:04:03 UTC; 13min ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 26196 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
CPU: 26ms
Feb 06 15:04:03 user systemd[1]: Starting The Apache HTTP Server...
Feb 06 15:04:03 user apachectl[26199]: AH00526: Syntax error on line 1 of /etc/apache2/conf-enabled/ssl-params.conf:
Feb 06 15:04:03 user apachectl[26199]: Invalid command 'SSLCipherSuite', perhaps misspelled or defined by a module not included in the server configuration
Feb 06 15:04:03 user apachectl[26196]: Action 'start' failed.
Feb 06 15:04:03 user apachectl[26196]: The Apache error log may have more information.
Feb 06 15:04:03 user systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Feb 06 15:04:03 user systemd[1]: apache2.service: Failed with result 'exit-code'.
Feb 06 15:04:03 user systemd[1]: Failed to start The Apache HTTP Server.
答案1
错误信息中清楚地显示了问题的原因:
2 月 6 日 15:04:03 用户 apachectl[26199]: 无效命令‘SSLCipherSuite’,可能是拼写错误或由服务器配置中未包含的模块定义
因此,您禁用了 SSL 模块,但仍使用仅此模块可用的配置选项。您还需要删除这些配置选项。