作者:手机用户2502884601 | 来源:互联网 | 2022-01-22 09:23
这篇文章主要介绍了Linux环境下Apache开启https服务的方法,结合实例形式分析了阿里云环境下获取SSL证书及Apache服务器安装、开启SSL的相关操作技巧,需要的朋友可以参考下
本文实例讲述了Linux环境下Apache开启https服务的方法。分享给大家供大家参考,具体如下:
首先申请SSL证书,以阿里云为例,找到域名管理:

免费开启SSL证书:

配置单域名免费证书:(有效期一年)

点击确定,验证证书:

审核成功后可以下载证书:

下载Apache的SSL证书:

解压出来这三个我放到了Apache安装目录/etc/httpd/cert下面

httpd.conf 里面加这个(引入conf.d文件夹下面的全部conf):
运行这两个:
yum install mod_ssl
yum install openssl openssl-devel
找到这个文件 /etc/httpd/conf.d/ssl.conf:

替换全部内容:
DocumentRoot "/var/www/html"
ServerName www.msllws.top
SSLEngine on
SSLCertificateFile /etc/httpd/cert/932538_www.msllws.top_public.crt
SSLCertificateKeyFile /etc/httpd/cert/932538_www.msllws.top.key
SSLCertificateChainFile /etc/httpd/cert/932538_www.msllws.top_chain.crt
NameVirtualHost *:443
然后就可以访问https了
希望本文所述对大家Linux服务器配置有所帮助。