Wamp Apache:用于 VirtualHost 的端口:443 不是 Apache Listen 端口

问题描述 投票:0回答:1

在我的虚拟主机列表中:

testwordpress:443 - 不是监听端口

用于 VirtualHost 的端口:443 不是 Apache Listen 端口

https-vhosts.conf:

<VirtualHost *:443>

    ServerName testwordpress
    DocumentRoot "c:/wamp64/www/testwordpress"
    SSLEngine on
    
    SSLCertificateFile "${SRVROOT}/conf/key/certificate.crt"
    SSLCertificateKeyFile "${SRVROOT}/conf/key/private.key"
    
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
    
    
    <Directory  "c:/wamp64/www/testwordpress/">
        SSLOptions +StdEnvVars
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
    
    BrowserMatch "MSIE [2-5]" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0

    CustomLog "${SRVROOT}/logs/ssl_request.log" \
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    </VirtualHost>

httpd-ssl.conf:

    DocumentRoot "${INSTALL_DIR}/www"
    ServerName localhost:443
    ServerAdmin [email protected]
    SSLCertificateKeyFile "${SRVROOT}/conf/key/private.key"
    SSLCertificateFile "${SRVROOT}/conf/key/certificate.crt"

httpd.conf:

    LoadModule ssl_module modules/mod_ssl.so
    Include conf/extra/httpd-ssl.conf
    LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
    

文件存在于正确的文件夹中:

日志:

[Wed Jun 08 11:20:14.280523 2022] [mpm_winnt:notice] [pid 16492:tid 648] AH00455: Apache/2.4.51 (Win64) OpenSSL/1.1.1l PHP/7.4.26 configured -- resuming normal operations
[Wed Jun 08 11:20:14.280523 2022] [mpm_winnt:notice] [pid 16492:tid 648] AH00456: Apache Lounge VS16 Server built: Oct  7 2021 16:27:02
[Wed Jun 08 11:20:14.280523 2022] [core:notice] [pid 16492:tid 648] AH00094: Command line: 'c:\\wamp64\\bin\\apache\\apache2.4.51\\bin\\httpd.exe -d C:/wamp64/bin/apache/apache2.4.51'
[Wed Jun 08 11:20:14.281523 2022] [mpm_winnt:notice] [pid 16492:tid 648] AH00418: Parent: Created child process 26888
[Wed Jun 08 11:20:14.444523 2022] [ssl:warn] [pid 26888:tid 604] AH01906: testwordpress:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Jun 08 11:20:14.445523 2022] [ssl:warn] [pid 26888:tid 604] AH01909: testwordpress:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jun 08 11:20:14.463523 2022] [ssl:warn] [pid 26888:tid 604] AH01906: testwordpress:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Jun 08 11:20:14.463523 2022] [ssl:warn] [pid 26888:tid 604] AH01909: testwordpress:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jun 08 11:20:14.479523 2022] [mpm_winnt:notice] [pid 26888:tid 604] AH00354: Child: Starting 64 worker threads.

可能是什么问题?

apache ssl port wamp
1个回答
0
投票

必须分开虚拟主机的定义。 将 http <*:80> 版本放入 httpd-vhosts.conf,带 Redirect 参数。

<VirtualHost *:80>
  ServerName localhost
  Redirect localhost https://localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost> 

conf/extra/httpd-ssl.conf 中的 https<*:443> 版本

© www.soinside.com 2019 - 2024. All rights reserved.