Apache版本2.4 
安装mod_ssl

yum install mod_ssl

建立文件夹,存放sslkey

mkdir /etc/httpd/ssl/

建立凭证档

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/ssl/apache.key -out /etc/httpd/ssl/apache.crt

...........................................................+++
..............+++
writing new private key to '/etc/httpd/ssl/apache.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CHN
string is too long, it needs to be less than 2 bytes long
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:HB
Locality Name (eg, city) [Default City]:WH
Organization Name (eg, company) [Default Company Ltd]:ZZ
Organizational Unit Name (eg, section) []:ZZ
Common Name (eg, your name or your server's hostname) []:WWW^H^[[3~^[[3~^[[3~^[[3~^[[3~^[[3~
Email Address []:webmaster@xxx.com

需要填写一些内容,我随便填的…

apache配置 
/etc/httpd/conf.d/ssl.conf 
我把这下面的内容复制到另外一个文件中配置的

<VirtualHost _default_:443>
*****
</VirtualHost>

需要修改的几项

DocumentRoot "/var/www/example.com/public_html"

ServerName www.example.com:443

SSLCertificateFile /etc/httpd/ssl/apache.crt
SSLCertificateKeyFile /etc/httpd/ssl/apache.key

重启apache

systemctl restart httpd.service

通过以上步骤就能打开网页的https链接了,但是此时的https浏览器会提示不安全的链接,那么就需要到阿里云去申请一个CA证书,目前有免费版的CA证书,下面的链接是我发在百度的申请证书的教程,大家可以参考一下

https://jingyan.baidu.com/album/4b07be3c92836148b380f318.html

上一个效果图

https变成绿色,说明证书生效!

centos7配置Apache支持HTTPS的更多相关文章

  1. Windows 下配置 Apache 支持 https

    1.打开cmd ,输入  F: // 切换到Apache安装路径,我的Apache安装目录在 F盘 2.cd F:\Apache\bin 3.set "openssl_conf = F:\A ...

  2. windows配置apache支持https

    https://my.oschina.net/ososchina/blog/510065

  3. php源码安装,并配置apache支持php

    一.php安装准备环境 yum install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-deve ...

  4. Ubuntu14.04配置Apache支持多个站点

    怎样在一个Ubuntu的机器上(虚拟机)配置Apache支持多个网站呢? 比如你有一台独立的Ubuntu虚拟机,配有一个外网的IP(45.46.47.48),并且注册了两个域名AAA.com和BBB. ...

  5. 在一个Ubuntu系统上配置Apache支持多个站点

    查看原文请访问:http://codewenda.com/ubuntu16-04%E9%85%8D%E7%BD%AEapache%E6%94%AF%E6%8C%81%E5%A4%9A%E4%B8%AA ...

  6. 配置nginx支持Https

    配置nginx支持Https一定要先使用stop停止nginx然后重新代开不能使用reload 一:安装letsencrypt 1.从git上克隆下来git clone https://github. ...

  7. Spring Mvc和Spring Boot配置Tomcat支持Https

    SpringBoot配置支持https spring boot因为是使用内置的tomcat,所以只需要一些简单的配置即可. 1.首先打开命令行工具,比如cmd,输入以下命令 keytool -genk ...

  8. Springboot 配置 ssl 实现HTTPS 请求 & Tomcat配置SSL支持https请求

    SSL(Secure Sockets Layer 安全套接层),及其继任者传输层安全(Transport Layer Security,TLS)是为网络通信提供安全及数据完整性的一种安全协议.TLS与 ...

  9. Linux下设置Apache支持Https服务

    HTTPS的主要作用: 1)建立一个信息安全通道,来保证数据传输的安全性 2)确认网站的真实性 HTTPS与HTTP的区别: 1)HTTPS协议需要到ca申请证书,免费证书较少 2)HTTP是超文本传 ...

随机推荐

  1. 安装Oracle11g的依赖包

    binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 elfutils-libelf-0.125 elfutils-libelf-devel-0.125 elf ...

  2. Go a lot of way but I go back to the original point

    I try a lot of blog platform and even construct my blog website. But I have to say I just want to ha ...

  3. Could not create the view: An unexpected exception was thrown的解决方法

    MyEclipse下面的server窗口突然不能正常显示了,而且还显示Could not create the view: An unexpected exception was thrown(无法创 ...

  4. 二分查找(binary search)java实现及时间复杂度

    概述 在一个已排序的数组seq中,使用二分查找v,假如这个数组的范围是[low...high],我们要的v就在这个范围里.查找的方法是拿low到high的正中间的值,我们假设是m,来跟v相比,如果m& ...

  5. Mybatis转义字符

    Mybatis的sql语句中需要用到'>'或者'<'时,不能直接使用. < < 小于号 > > 大于号 & & 和 &apos; ' 单引号 ...

  6. sharepoint REST API 获取文件夹及文件

    使用REST操作文件夹: 获取文件夹 url: http://site url/_api/web/GetFolderByServerRelativeUrl('/Shared Documents')/f ...

  7. 【Python】 更棒的Excel操作模块xlwings

    [xlwings] 说到Python操作Excel,有好多模块都可以支持这个工作.比如最底层的win32模块不仅可以操作Excel,还可以操作其他一众windows的软件. 其他的比较熟悉的有xlrd ...

  8. Redis这些知识点,是必须知道的!

    Redis是一个开源(BSD许可)的内存数据结构存储,可作为数据库,缓存和消息队列.相比Memcached它支持更多的数据结构,如string(字符串),hash(哈希),list(链表),set(集 ...

  9. JavaScript(第二十四天)【事件对象】

    JavaScript事件的一个重要方面是它们拥有一些相对一致的特点,可以给你的开发提供更多的强大功能.最方便和强大的就是事件对象,他们可以帮你处理鼠标事件和键盘敲击方面的情况,此外还可以修改一般事件的 ...

  10. 解决fiddler无法抓取本地部署项目的请求问题

    在本地部署了几个应用,然后想用fiddler抓取一些请求看看调用了哪些接口,然鹅,一直抓不到... 比如访问地址是这样的: 在网上搜罗半天,找到一个解决方法 在localhost或127.0.0.1后 ...