簡體   English   中英

如何在 Apache 2.4 (Windows 7) 上配置 SSL?

[英]How to configure SSL on Apache 2.4 (Windows 7)?

我正在嘗試在我的電腦(Windows 7)上安裝和配置 Apache 2.4。

我還需要 PHP 和 SSL。

使用 http 和 php 一切正常,但我在使用 https 時遇到了一些麻煩。

我在網上搜索了一些教程,我找到了這個: http : //www.silverwareconsulting.com/index.cfm/2009/3/31/Enabling-SSL-on-Apache-on-Windows

在我的 httpd-vhosts.conf 文件中,我創建了兩個虛擬主機定義......

<VirtualHost *:80>
  ServerAdmin webmaster@dummy-host.example.com
  DocumentRoot "D:/Cesare/Personale/DocumentRootApache"
  ServerName localhost
  ServerAlias localhost
  ErrorLog "logs/localhost.com-error.log"
  CustomLog "logs/localhost-access.log" common    
  <Directory "D:/Cesare/Personale/DocumentRootApache">
   Options Indexes FollowSymLinks
   AllowOverride All
   Require all granted
  </Directory>    
</VirtualHost>

<VirtualHost *:443>
   SSLEngine on
   SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
   SSLCertificateFile "D:/Programmi/ApacheSoftwareFoundation/Apache24/conf/ssl/cesare.cert"
   SSLCertificateKeyFile "D:/Programmi/ApacheSoftwareFoundation/Apache24/conf/ssl/cesare.key"
   ServerAdmin webmaster@dummy-host.example.com
   DocumentRoot "D:/Cesare/Personale/DocumentRootApacheHttps"
   ServerName localhost
   DirectoryIndex index.html, index.cfm, index.php
   ErrorLog "logs/localhost.com-error.log"
   CustomLog "logs/localhost-access.log" common
   <Directory "D:/Cesare/Personale/DocumentRootApacheHttps">
    Options All
    AllowOverride All
   </Directory>
</VirtualHost>

所有目錄都存在於我的電腦上,我已經檢查過了。

當我嘗試使用 url 訪問時

https://localhost/index.html

回應是

Forbidden

You don't have permission to access /index.html on this server.

有什么建議? 如果需要,我可以提供有關我的 apache 配置的其他信息。

先感謝您

由於權限而不是 SSL/TLS 錯誤,您無法獲取該文件的事實表明這不是 HTTPS 設置錯誤。

我建議您需要添加以下內容:

Require all granted

到您的 443 虛擬主機的目錄配置以允許訪問此目錄。 你的 80 虛擬主機上有這個。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM