apache安装https证书
来源:互联网 发布:怎样评价日剧 知乎 编辑:程序博客网 时间:2024/05/18 11:26
1.首先 升级liunx 的 openSSl;
- wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_2h.tar.gz
- tar -zvxf OpenSSL_1_0_2h.tar.gz
- cd openssl-OpenSSL_1_0_2h
- 编译安装到相应的目录(/usr/local/openssl )
- ./config --prefix=/usr/local --openssldir=/usr/local/openssl
- make
- make test
- make install
- 安装好以后使用 openssl version 命令查看版本为 OpenSSL 1.0.2h 3 May 2016 ,就ok了。
2.然后 apache 使用 yum install mod_ssl 增加 ssl 模块,并且配置;
- 这里的环境是 apache 是使用 yum 安装的,并且安装的时候没有引入 mod_ssl模块,所以需要增加该模块。
- 使用命令 yum install mod_ssl 增加 ssl 模块。
- 增加成功以后会在 /etc/httpd/conf.d/ 目录下发现有个ssl.conf文件
- 需要在http.conf 文件中引入 mod_ssl 模块,在该文件中搜索 LoadModule,找到以后再下一行增加: LoadModule ssl_module modules/mod_ssl.so
- 由于https 使用的是 443端口,所以需要在http.conf 中增加监听 443端口,搜索Listen 80,然后在下一行增加 Listen 443
- 需要排除443端口是否被占用,我这里就是因为443端口被占用了,所以没成功,使用lsof -i:443 查看端口占用进程,发现进程被一个过期的https 证书程序占用
- 于是使用 kill -9 进程Id ,杀掉该进程。
- http.conf 文件中增加443 host配置,这个配置加在你apache 转发配置的下面(还有种方式是在ssl.conf文件中配置,我这里觉得麻烦没去用了,直接在http.conf中配置的),配置如下:
- <VirtualHost *:443>
SSLEngine on
DocumentRoot "你的网站目录"
ServerName 你的域名
SSLCertificateFile /usr/local/httpsKey/server.crt
SSLCertificateKeyFile /usr/local/httpsKey/server.key
SSLCertificateChainFile /usr/local/httpsKey/intermediate.crt
</VirtualHost>
3.上面配置的三个文件,你购买证书签发成功以后都会给你的,自己上传建个目录放好就可以了。
/usr/local/httpsKey/server.crt
/usr/local/httpsKey/server.key
/usr/local/httpsKey/intermediate.crt
4.说明
server.crt 是ssl 证书。
server.key 是私匙,是刚开始用工具生成csr文件的时候所得。
intermediate.crt 是中级证书。
0 0
- apache安装https证书
- Apache服务器安装https证书
- Apache服务器安装https证书
- Apache 部署https证书
- wdcp + apache + 阿里云ssl证书安装https
- Ubuntu 16.04 Apache https设置及SSL免费证书安装
- (SSL证书)apache添加https
- jdk安装https证书
- tomcat安装Https证书
- HTTPS证书安装 - SSL certificate from Godaddy 安装到Ubuntu上的Apache (精简步骤)
- Weblogic 安装 https证书 + 修改
- 阿里云https证书安装
- 如何在安装SSL证书后强制Apache的http请求跳转到https
- php wamp apache https 之 ssl安全证书的获取和安装
- Apache+OpenSSL实现证书服务器提供HTTPS
- Apache更换ssl https证书问题注意事项
- 搭建有效证书的HTTPS网站-Apache
- 网站升级HTTPS,免费SSL证书Let’s Encrypt安装使用教程:Apache和Nginx配置方法
- qt designer 界面设计填坑之路 一
- ant利用正则表达式获取文件夹名
- google 选择坐标
- 38. Count and Say
- android中getWidth()和getMeasuredWidth()之间的区别
- apache安装https证书
- UEFI/Legacy的设置更改 以及硬盘模式的更改
- js中的变量提升
- 使用nginx与nginx-rtmp-module搭建流媒体服务器
- SQL优化,oracle trace使用
- web.xml中url-pattern匹配规则
- tomcat启动,但是spring配置的bean并没有初始化
- Javascript正则表达式详细讲解和示例,通俗易懂
- Android之ViewHolder用法