Linux

為 SERVER 配置的 RSA 證書不包含與伺服器名稱匹配的 ID

  • February 22, 2019

我最近啟動了一個帶有 WordPress 的 LAMP 伺服器(所有最新版本),並且我正在嘗試安裝我最近購買的 SSL 證書。當我重新啟動時apachectl,error_log 給了我這個:

[Tue Feb 25 01:07:14.744222 2014] [mpm_prefork:notice] [pid 1744] AH00169: caught SIGTERM, shutting down
[Tue Feb 25 01:07:17.135704 2014] [suexec:notice] [pid 1765] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Feb 25 01:07:17.217424 2014] [auth_digest:notice] [pid 1766] AH01757: generating secret for digest authentication ...
[Tue Feb 25 01:07:17.218686 2014] [lbmethod_heartbeat:notice] [pid 1766] AH02282: No slotmem from mod_heartmonitor
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/5.5/modules/mysql.so' - /usr/lib64/php/5.5/modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/5.5/modules/mysqli.so' - /usr/lib64/php/5.5/modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Tue Feb 25 01:07:17.305292 2014] [mpm_prefork:notice] [pid 1766] AH00163: Apache/2.4.6 (Amazon) OpenSSL/1.0.1e-fips PHP/5.5.7 configured -- resuming normal operations
[Tue Feb 25 01:07:17.305378 2014] [core:notice] [pid 1766] AH00094: Command line: '/usr/sbin/httpd'

雖然 ssl_error_log 給了我這個:

[Tue Feb 25 00:57:15.802287 2014] [ssl:warn] [pid 1705] AH01909: RSA certificate configured for ec2-XX-XXX-XXX-XX.compute-1.amazonaws.com:443 does NOT include an ID which matches the server name
[Tue Feb 25 00:57:15.899327 2014] [ssl:warn] [pid 1706] AH01909: RSA certificate configured for ec2-XX-XXX-XXX-XX.compute-1.amazonaws.com:443 does NOT include an ID which matches the server name

我將“ServerName”更改ssl.conf為我的伺服器名稱(dcturano.com)並重新啟動apachectl,但出現此錯誤。任何想法為什麼?

順便說一句,我沒有設置伺服器的 CommonName,這可能是問題嗎?

openssl x509 -in server.crt -noout -subject

應返回證書的CN。這是您必須在 ServerName 指令中使用並連接到的名稱。

我有同樣的問題,但這是因為另一個原因。我在這里為未來的Google人發布它:

在我的 apache2 配置文件中<VirtualHost *:443>,我沒有<VirtualHost *:80>. 一旦我解決了這個問題,該網站就會恢復執行。

引用自:https://serverfault.com/questions/578061