首页 > 解决方案 > Django Apache - 没有启动 HTTPS 的虚拟主机

问题描述

我只想VirtualHost用 Apache 在 https 上创建一个。我浏览了一半的互联网,但没有任何帮助。我使用 OpenSSL 作为证书,我的操作系统是 Windows。

Listen 443
<VirtualHost *:443>
    ServerName www.foo.com
    ServerAlias foo.com

    SSLEngine On
    SSLCertificateFile C:/Users/Myzel394/Documents/foo/certificate/aula_com.csr
    SSLCertificateKeyFile C:/Users/Myzel394/Documents/foo/certificate/aula_com.key

    DocumentRoot C:/Users/Myzel394/Documents/foo
    WSGIScriptAlias / C:/Users/Myzel394/Documents/foo/foo/wsgi.py 

    <Directory C:/Users/Myzel394/Documents/foo/foo>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>
</VirtualHost>

我的错误信息:

[Sun May 12 17:26:08.353667 2019] [ssl:warn] [pid 20204:tid 768] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:26:08.396654 2019] [ssl:warn] [pid 20204:tid 768] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:26:08.420646 2019] [mpm_winnt:notice] [pid 20204:tid 768] AH00455: Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.5 configured -- resuming normal operations
[Sun May 12 17:26:08.420646 2019] [mpm_winnt:notice] [pid 20204:tid 768] AH00456: Apache Lounge VC15 Server built: Mar 28 2018 12:12:41
[Sun May 12 17:26:08.420646 2019] [core:notice] [pid 20204:tid 768] AH00094: Command line: 'C:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun May 12 17:26:08.422646 2019] [mpm_winnt:notice] [pid 20204:tid 768] AH00418: Parent: Created child process 24792
[Sun May 12 17:26:08.943479 2019] [ssl:warn] [pid 24792:tid 732] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:26:08.977486 2019] [ssl:warn] [pid 24792:tid 732] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:26:09.003479 2019] [mpm_winnt:notice] [pid 24792:tid 732] AH00354: Child: Starting 150 worker threads.
[Sun May 12 17:28:47.449329 2019] [mpm_winnt:notice] [pid 20204:tid 768] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun May 12 17:28:49.450681 2019] [mpm_winnt:notice] [pid 24792:tid 732] AH00364: Child: All worker threads have exited.
[Sun May 12 17:28:49.470981 2019] [mpm_winnt:notice] [pid 20204:tid 768] AH00430: Parent: Child process 24792 exited successfully.
[Sun May 12 17:44:12.811155 2019] [ssl:warn] [pid 20096:tid 740] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:12.848141 2019] [ssl:warn] [pid 20096:tid 740] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:12.872133 2019] [mpm_winnt:notice] [pid 20096:tid 740] AH00455: Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.5 configured -- resuming normal operations
[Sun May 12 17:44:12.873133 2019] [mpm_winnt:notice] [pid 20096:tid 740] AH00456: Apache Lounge VC15 Server built: Mar 28 2018 12:12:41
[Sun May 12 17:44:12.873133 2019] [core:notice] [pid 20096:tid 740] AH00094: Command line: 'C:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun May 12 17:44:12.874133 2019] [mpm_winnt:notice] [pid 20096:tid 740] AH00418: Parent: Created child process 4512
[Sun May 12 17:44:13.311026 2019] [ssl:warn] [pid 4512:tid 664] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:13.344016 2019] [ssl:warn] [pid 4512:tid 664] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:13.370022 2019] [mpm_winnt:notice] [pid 4512:tid 664] AH00354: Child: Starting 150 worker threads.
[Sun May 12 17:44:14.456350 2019] [mpm_winnt:notice] [pid 20096:tid 740] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun May 12 17:44:16.457941 2019] [mpm_winnt:notice] [pid 4512:tid 664] AH00364: Child: All worker threads have exited.
[Sun May 12 17:44:16.475935 2019] [mpm_winnt:notice] [pid 20096:tid 740] AH00430: Parent: Child process 4512 exited successfully.
[Sun May 12 17:44:19.178024 2019] [ssl:warn] [pid 10936:tid 760] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:19.214875 2019] [ssl:warn] [pid 10936:tid 760] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:19.238868 2019] [mpm_winnt:notice] [pid 10936:tid 760] AH00455: Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.5 configured -- resuming normal operations
[Sun May 12 17:44:19.238868 2019] [mpm_winnt:notice] [pid 10936:tid 760] AH00456: Apache Lounge VC15 Server built: Mar 28 2018 12:12:41
[Sun May 12 17:44:19.238868 2019] [core:notice] [pid 10936:tid 760] AH00094: Command line: 'C:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun May 12 17:44:19.240867 2019] [mpm_winnt:notice] [pid 10936:tid 760] AH00418: Parent: Created child process 16324
[Sun May 12 17:44:19.779509 2019] [ssl:warn] [pid 16324:tid 660] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:19.815498 2019] [ssl:warn] [pid 16324:tid 660] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:19.840480 2019] [mpm_winnt:notice] [pid 16324:tid 660] AH00354: Child: Starting 150 worker threads.
[Sun May 12 17:44:20.718806 2019] [mpm_winnt:notice] [pid 10936:tid 760] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun May 12 17:44:22.719903 2019] [mpm_winnt:notice] [pid 16324:tid 660] AH00364: Child: All worker threads have exited.
[Sun May 12 17:44:22.738926 2019] [mpm_winnt:notice] [pid 10936:tid 760] AH00430: Parent: Child process 16324 exited successfully.
[Sun May 12 17:44:26.860235 2019] [ssl:warn] [pid 18248:tid 740] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:26.897262 2019] [ssl:warn] [pid 18248:tid 740] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:26.922251 2019] [mpm_winnt:notice] [pid 18248:tid 740] AH00455: Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.5 configured -- resuming normal operations
[Sun May 12 17:44:26.922251 2019] [mpm_winnt:notice] [pid 18248:tid 740] AH00456: Apache Lounge VC15 Server built: Mar 28 2018 12:12:41
[Sun May 12 17:44:26.922251 2019] [core:notice] [pid 18248:tid 740] AH00094: Command line: 'C:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun May 12 17:44:26.924250 2019] [mpm_winnt:notice] [pid 18248:tid 740] AH00418: Parent: Created child process 6996
[Sun May 12 17:44:27.370110 2019] [ssl:warn] [pid 6996:tid 716] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:27.403127 2019] [ssl:warn] [pid 6996:tid 716] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:27.430119 2019] [mpm_winnt:notice] [pid 6996:tid 716] AH00354: Child: Starting 150 worker threads.
[Sun May 12 17:44:29.776464 2019] [mpm_winnt:notice] [pid 18248:tid 740] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun May 12 17:44:31.777817 2019] [mpm_winnt:notice] [pid 6996:tid 716] AH00364: Child: All worker threads have exited.
[Sun May 12 17:44:31.796389 2019] [mpm_winnt:notice] [pid 18248:tid 740] AH00430: Parent: Child process 6996 exited successfully.
[Sun May 12 17:44:39.901770 2019] [ssl:warn] [pid 1032:tid 740] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:39.902765 2019] [ssl:emerg] [pid 1032:tid 740] AH02572: Failed to configure at least one certificate and key for www.www.foo.com:80
[Sun May 12 17:44:39.902765 2019] [ssl:emerg] [pid 1032:tid 740] SSL Library Error: error:0906D06C:PEM routines:PEM_read_bio:no start line (Expecting: DH PARAMETERS) -- Bad file contents or format - or even just a forgotten SSLCertificateKeyFile?
[Sun May 12 17:44:39.902765 2019] [ssl:emerg] [pid 1032:tid 740] SSL Library Error: error:0906D06C:PEM routines:PEM_read_bio:no start line (Expecting: EC PARAMETERS) -- Bad file contents or format - or even just a forgotten SSLCertificateKeyFile?
[Sun May 12 17:44:39.902765 2019] [ssl:emerg] [pid 1032:tid 740] SSL Library Error: error:140A80B1:SSL routines:SSL_CTX_check_private_key:no certificate assigned
[Sun May 12 17:44:39.902765 2019] [ssl:emerg] [pid 1032:tid 740] AH02312: Fatal error initialising mod_ssl, exiting.
AH00016: Configuration Failed
[Sun May 12 17:44:57.480579 2019] [ssl:warn] [pid 22708:tid 740] AH01909: www.example.com:50000:0 server certificate does NOT include an ID which matches the server name
[Sun May 12 17:44:57.481578 2019] [ssl:emerg] [pid 22708:tid 740] AH02562: Failed to configure certificate www.www.foo.com:443:0 (with chain), check C:/Users/Myzel394/Documents/foo/certificate/aula_com.csr
[Sun May 12 17:44:57.481578 2019] [ssl:emerg] [pid 22708:tid 740] SSL Library Error: error:0906D06C:PEM routines:PEM_read_bio:no start line (Expecting: TRUSTED CERTIFICATE) -- Bad file contents or format - or even just a forgotten SSLCertificateKeyFile?
[Sun May 12 17:44:57.481578 2019] [ssl:emerg] [pid 22708:tid 740] SSL Library Error: error:140DC009:SSL routines:use_certificate_chain_file:PEM lib
AH00016: Configuration Failed

标签: djangoapache

解决方案


推荐阅读