Apache 安装设置证书支持https

2017/7/28 19:11:41      点击:
Listen 443
80端口配置开始
<VirtualHost *:80>
    ServerAdmin   admin@ domain.com 
    DocumentRoot "{此处写网站绝对路径}"
    DirectoryIndex index.html index.php
    ServerName  domain.com 
    ServerAlias    www.domain.com 
<Directory "{此处写网站绝对路径}"> #如   D:/wwwroot/web1
      Options  FollowSymLinks
      AllowOverride All
      Require all granted
    </Directory>  
</VirtualHost>
## 80端口结束
## 443端口  SSL配置开始
<VirtualHost *:443>
    ServerAdmin    admin@domain.com
    DocumentRoot "{此处写网站绝对路径}"
    DirectoryIndex index.html index.php
    ServerName domain.com                 #域名   
    ServerAlias   www.youdomian.com  #域名

    SSLEngine on
    SSLCertificateFile  ssl\2_domain.com.crt
    SSLCertificateKeyFile  ssl\3_domain.com.key
    SSLCertificateChainFile  ssl\1_root_bundle.crt
   
  # 把下载好的证书加压出来复制到Apahce 安装目录下 ssl  文件夹内,分别修改上面三行中的
  # 2_domain.com.crt   3_domain.com.key    1_root_bundle.crt   为您的证书文件名称
    <Directory "{此处写网站绝对路径}">
      Options  FollowSymLinks
      AllowOverride All
      Require all granted
    </Directory>  
</VirtualHost>
# SSL配置结束