博主今天打算配置一个多证书的apache,达到多域名可以通过https://***,来访问。根据网上的教程,只要添加多个<VirtualHost *:443>就可以达到这个效果。但是重启httpd,总会提示:
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
用命令 journalctl -xe 查看:
systemd[1]: Unit httpd.service entered failed state.
systemd[1]: httpd.service failed.
polkitd[475]: Registered Authentication Agent for unix-process:7076:2357584 (system bus name :1.219 [/usr/bin/pkttyagent -.....
完全看不出哪里有问题(此时博主还不知道httpd有一个error_log,捂脸)
折腾了好久,终于打开/var/log/httpd/error_log来看
AH02312: Fatal error initialising mod_ssl, exiting.
SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
Permission denied: AH02201: Init: Can't open server certificate file
博主看到这个错误信息,顿时明白了原来是SELinux的原因!!之前在SELinux上面吃了不