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

发布于 2025-02-05 05:38:22 字数 3151 浏览 2 评论 0原文

在我的VirtualHosts列表中:

testWordPress:443-不是听端口

端口:443用于VirtualHost的443不是Apache teli port port

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 。

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

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

​i.sstatic.net/dtx9b.png“ alt =“在此处输入图像说明”>

logs:

[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.

有什么问题?

In my list of VirtualHosts:

testwordpress:443 - Not a Listen port

Port :443 used for the VirtualHost is not an Apache Listen port

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)
quot;>
        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
    

Files are present in the right folder:

enter image description here

Logs:

[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.

What can be the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呆头 2025-02-12 05:38:22

您必须将虚拟主机的定义分开。
放置http&lt;*:80&gt; httpd-vhosts.conf中的版本,带有重定向参数。

<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> 

和https&lt;*:443&gt; conf/extra/httpd-ssl.conf中的版本

You must separate the definitions of virtual hosts.
Put the http <*:80> version in httpd-vhosts.conf, with Redirect parameter.

<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> 

And https <*:443> version in conf/extra/httpd-ssl.conf

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文