Windows下Apache配置https

一、將mycert.crt 和mycert.key 文件複製到Apache 一級目錄中

 

二、httpd.conf 開啓相關的loadModule
LoadModule ssl_module modules/mod_ssl.so 去掉前面#號 其餘須要開啓的 根據錯誤提示逐個開啓

 

三、http-vhost.conf 加入配置
#原始配置 能夠保留
listen 80
<VirtualHost *:80>
   DocumentRoot "D:/website/seo/public"
   ServerName www.test.com
  DirectoryIndex index.php index.html
  <Directory "D:/website/seo/public">
     Options FollowSymLinks
     AllowOverride All
     Order allow,deny
     Allow from all
   </Directory>
    CustomLog "logs/test.log" combined
</VirtualHost>

#https配置
listen 443
<VirtualHost *:443>
   DocumentRoot "D:/website/seo/public"
   ServerName www.test.com
   SSLEngine on SSLCertificateFile mycert.crt SSLCertificateKeyFile mycert.key
  DirectoryIndex index.php index.html
  <Directory "D:/website/seo/public">
     Options FollowSymLinks
     AllowOverride All
     Order allow,deny
     Allow from all
   </Directory>
    CustomLog "logs/test.log" combined
</VirtualHost>
 
四、重啓Apache
相關文章
相關標籤/搜索