apache ssl 在 windows 下的配置 ,常用于https文件的访问

第一次配置apache的https的访问,所以记录下,备忘

首先,你需要在阿里或者腾讯这些网站上申请https证书,申请后, 会得到.key,.public,.chain 这三个文件,需要把这个文件上传到服务器指定的目录下,备用

1 打开apache的配置文件 ,默认位置在  apache安装目录/conf/httpd.conf 中,开启SSL模块的注释,apache的注释是# 去掉即可

2 因为在apache下是在虚拟主机模块里配置服务端的模块内容,所以就会是类似这样的模块


  #443端口

    DocumentRoot "rootpath\path\webpath"   #文档根目录

    ServerName  exmple.com  #域名

    ServerAlias aa.exmple.com #域名别名,可以不配置

     #项目目录

      Options FollowSymLinks ExecCGI  #CGI模块

      AllowOverride All   

      Order allow,deny

      Allow from all

      Require all granted  

 

SSLEngine on   #开启ssl解析

SSLCertificateFile:rootpath\path\webpath\certpath\\hostname.crt  #cert证书文件目录

SSLCertificateKeyFile: rootpath\path\webpath\publicpath\hostname.key  #公钥

SSLCertificateChainFile rootpath\path\webpath\chainpath\exmple.chain  #私钥

#结束




https下,所有的文件都会引用https的路径,默认不会引入http格式的文件


参考资料  [1]  apache中的https设置基于阿里云免费ssl服务 - 猿子 - CSDN博客

你可能感兴趣的:(apache ssl 在 windows 下的配置 ,常用于https文件的访问)