Apache2.4.7配置https,解决阿里云证书配置之痛
来源:互联网 发布:刘嘉玲绑架事件知乎 编辑:程序博客网 时间:2024/05/19 06:17
Chrome封杀80网站(http),逼迫小网开启443(https)。如果没有这个的话就会被浏览器或电脑管家认定为不安全的网站,当然可继续访问,但是当很多人投诉你的网站就会立刻想到与木马病毒相关的东西,认为这不是一个好网站。
阿里云服务器开启https还是蛮麻烦的,还好Symantec证书是免费提供1年。虽然阿里云给出了证书及教程,然没有Apache2.4.7版本的。
阿里云提供了3个证书,public.pem和21#######63.key(为SSLCertificateFile),chain.pem(为Server Certificate Chain)。
下面开始配置一下apache2
使用复制密钥,开启ssl
mkdir /etc/apache2/ssl 创建ssl文件夹mv /download/public.pem /etc/apache2/ssl/public.pemmv /download/21#####63.key /etc/apache2/ssl/21#####63.keymv /download/chain.pem /etc/apache2/ssl/chain.pema2enmod ssl #启用ssl
修改ports.conf
vi /etc/apache2/ports.conf
修改内容为如下
Listen 80<IfModule ssl_module> Listen 443</IfModule><IfModule mod_gnutls.c> Listen 443</IfModule>
修改default-ssl
vi /etc/apache2/sites-available/default-ssl
在SSLEngine on 下面找到2行 注释掉
# SSLCertificateFile directive is needed. SSLCertificateFile /etc/apache2/ssl/public.pem SSLCertificateKeyFile /etc/apache2/ssl/21#####63.key# Server Certificate Chain:# Point SSLCertificateChainFile at a file containing the# concatenation of PEM encoded CA certificates which form the# certificate chain for the server certificate. Alternatively# the referenced file can be the same as SSLCertificateFile# when the CA certificates are directly appended to the server# certificate for convinience. SSLCertificateChainFile /etc/apache2/ssl/chain.pem
启用ssl,重启apache
a2ensite default-ssl /etc/init.d/apache2 restart
htaccess将HTTP访问重定向至HTTPS
RewriteEngine onRewriteBase /RewriteCond %{SERVER_PORT} !^443$RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
重启apache即可使用。
参考资料:
http://blog.csdn.net/newjueqi/article/details/9789659
http://blog.csdn.net/buzaishabi/article/details/39346561
我的博客地址:https://www.nigaea.com/programmer/123.html
0 0
- Apache2.4.7配置https,解决阿里云证书配置之痛
- window2008下基于阿里云免费HTTPS证书+apache2.4.27的HTTPS配置方法
- 阿里云SLB HTTPS证书配置
- 阿里云https证书tomcat配置
- 阿里云服务器配置HTTPS证书记录
- Apache2.4.7配置https
- 阿里云https配置,nginx多证书配置
- 阿里云服务器Centos/tomcat6 配置http/https证书访问
- 关于apache配置阿里云证书https的步骤(详细)
- 阿里云免费DV证书Nginx配置https
- 阿里云配置小程序证书 https总结
- 阿里云https配置
- 阿里云Ubuntu16.04+apache2配置阿里云免费CA证书记录
- 配置赛门铁克(Symantec)https证书:从阿里云申请免费赛门铁克(Symantec)https证书并配置到cdn
- 购买阿里云免费https证书,配置tomcat实现https加密访问
- 微信小程序开发(6)---Tomcat配置阿里云SSL证书(配置HTTPS)
- Apache2配置https
- 配置apache2 https
- Java中实现FTP上传下载文件的功能
- Android进阶——Handler的应用之解决Only the original thread that created a view hierarchy can touch its views
- 相当昨晚和微微加班
- 富文本编辑器CKEditor的使用及同步问题
- android复习路之java基础下
- Apache2.4.7配置https,解决阿里云证书配置之痛
- C++11之基于范围的for循环(影响面广)
- 潜在威胁识别
- 正则表达式
- CSDN博客添加打赏功能( 非博客专家也可以设置)
- 并发之痛 Thread,Goroutine,Actor
- 我看看你今天上班骑车
- 组合控件之tab标签
- web.py模板之赋值