
내 SSL 가상 호스트는 다음과 같이 간단합니다.
LoadModule ssl_module modules/mod_ssl.so
Listen 443
<VirtualHost *:443>
DocumentRoot "/srv/www/test"
ServerName <my_website_domain>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
</VirtualHost>
Apache를 다시 시작하려고 하면 다음과 같은 apache2ctl configtest && systemctl restart apache2
결과가 나타납니다.
제어 프로세스가 오류 코드와 함께 종료되었기 때문에 apache2.service에 대한 구문 확인 작업이 실패했습니다. 자세한 내용은 "systemctl status apache2.service" 및 "journalctl -xe"를 참조하세요.
그러나 Apache로 SSLEngine을 끄면 SSLEngine off
정상적으로 시작됩니다.
systemctl status apache2
으로 시작한 후 실행하면 SSLEngine on
다음을 얻습니다.
Syntax OK
● apache2.service - The Apache Webserver
Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-08-14 18:06:55 CEST; 1min 9s ago
Process: 22352 ExecStop=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k graceful-stop (code=exited, status=0/SUCCESS)
Process: 19851 ExecReload=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k graceful (code=exited, status=0/SUCCESS)
Process: 22346 ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k start (code=exited, status=1/FAILURE)
Main PID: 22346 (code=exited, status=1/FAILURE)
Aug 14 18:06:55 luu056d start_apache2[22352]: [Fri Aug 14 18:06:55.351148 2020] [so:warn] [pid 22352] AH01574: module authn_core_module is already loaded, skipping
Aug 14 18:06:55 luu056d start_apache2[22352]: [Fri Aug 14 18:06:55.351163 2020] [so:warn] [pid 22352] AH01574: module authz_core_module is already loaded, skipping
Aug 14 18:06:55 luu056d start_apache2[22352]: [Fri Aug 14 18:06:55.351170 2020] [so:warn] [pid 22352] AH01574: module php5_module is already loaded, skipping
Aug 14 18:06:55 luu056d start_apache2[22352]: [Fri Aug 14 18:06:55.351179 2020] [so:warn] [pid 22352] AH01574: module ssl_module is already loaded, skipping
Aug 14 18:06:55 luu056d start_apache2[22352]: [Fri Aug 14 18:06:55.352998 2020] [so:warn] [pid 22352] AH01574: module ssl_module is already loaded, skipping
Aug 14 18:06:55 luu056d start_apache2[22352]: [Fri Aug 14 18:06:55.356261 2020] [core:warn] [pid 22352] AH00117: Ignoring deprecated use of DefaultType in line 143 of /etc/apa.../httpd.conf.
Aug 14 18:06:55 luu056d start_apache2[22352]: httpd (no pid file) not running
Aug 14 18:06:55 luu056d systemd[1]: Failed to start The Apache Webserver.
Aug 14 18:06:55 luu056d systemd[1]: apache2.service: Unit entered failed state.
Aug 14 18:06:55 luu056d systemd[1]: apache2.service: Failed with result 'exit-code'.
Hint: Some lines were ellipsized, use -l to show in full.
httpd (no pid file) not running
켤 때 왜 해당 오류가 발생합니까 SSLEngine
?
실행하면 lsof -i :443
결과가 비어 있으므로 포트 443을 차단하는 것은 없습니다.
Linux/SUSE에 Apache/2.4.23을 사용하고 있습니다.
답변1
이는 인증서에 문제가 있음을 나타냅니다. httpd는 인증서를 로드할 수 없으므로 제대로 시작할 수 없습니다. 일반적으로 SSL에 대한 오류 로깅 수준이 높지 않으면 이러한 오류는 표시되지 않습니다. 테스트용으로 설정 LogLevel ssl:trace8
하고 작동하게 되면 제거하세요.
인증서가 PEM 형식(ASCII)인지, 서로 일치하는지, 가리키는 경로에 있는지 확인하세요.
openssl x509 -in /etc/ssl/certs/apache-selfsigned.crt -noout -modulus
openssl rsa -in /etc/ssl/private/apache-selfsigned.key -noout -modulus
두 명령의 출력은 동일한 결과를 반환해야 하며, 그렇지 않은 경우 올바르지 않습니다.
답변2
답변을 주신 다른 모든 분들께 감사드리고 싶지만 문제는 파일에 있었습니다 ssl-globals.conf
.
이 두 지시어는 아파치를 충돌시켰습니다.
SSLUseStapling on
SSLStaplingCache "shmcb:logs/stapling-cache(150000)"
방금 댓글을 달았는데 이제 작동합니다. 이유는 모르겠지만 과학은 증거에 기초합니다.