现象:service httpd start 起不来,使用 systemctl status httpd 命令排查错误信息如下:
httpd[21703]: AH00526: Syntax error on line 6 of /etc/httpd/conf.d/example.com.conf: httpd[21703]: SSLCertificateFile: file '/var/certs/domain.cert' does not exist or is empty systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: httpd.service: Failed with result 'exit-code'. systemd[1]: Failed to start The Apache HTTP Server.
解决方案:必须将证书与私钥文件放到ssl.conf配置所在目录下,配置文件中证书路径可以写相对路径也可以写绝对路径