Windows Server 使用 WAMP 並配置 Https
阿新 • • 發佈:2020-11-01
Server 2016
安裝:vc2013_redist_x64.txt
再裝:wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-64b.exe
從https://certbot.eff.org/lets-encrypt/windows-apache 下載certbot-beta-installer-win32.exe,安裝。
執行命令:certbot certonly --webroot
按提示操作,輸入郵箱、域名、根目錄
然後生成了證書檔案:C:\Certbot\archive\[域名]
修改apache配置:
C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf 檔案中,
去掉Include conf/extra/httpd-ssl.conf 前邊的 #
去掉LoadModule ssl_module modules/mod_ssl.so 前邊的 #
修改conf/extra/httpd-ssl.conf 的檔案內容,把之前的全給丫刪了:
Listen 443 <VirtualHost *:443> SSLEngine on SSLProtocol all -SSLv2 -SSLv3 SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 SSLCertificateFile C:/Certbot/archive/[域名]/cert1.pem SSLCertificateKeyFile C:/Certbot/archive/[域名]/privkey1.pem SSLCertificateChainFile C:/Certbot/archive/[域名]/chain1.pem ServerName [域名] ServerAlias [域名] DocumentRoot C:/wamp/www/[路徑]/ DirectoryIndex index.html index.php<Directory /> Options +Indexes +FollowSymLinks +ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost>
重啟apache。
好了。