Linux下安全证书申请以及配置到Nginx
wget https://raw.githubusercontent.com/xdtianyu/scripts/master/lets-encrypt/letsencrypt.sh
chmod +x letsencrypt.sh
编辑下配置文件:
vim letsencrypt.conf
- ACCOUNT_KEY="letsencrypt-account.key"
- DOMAIN_KEY="域名.key"
- DOMAIN_DIR="网站文件夹"
- DOMAINS="DNS:域名,DNS:域名"
- #ECC=TRUE
- #LIGHTTPD=TRUE
运行:
./letsencrypt.sh letsencrypt.conf
运行后会生成很多文件
其中:
www.chained.crt 域名.key
这两个是要的
nginx配置:
- user www;
- worker_processes 1;
- #error_log logs/error.log;
- #error_log logs/error.log notice;
- #error_log logs/error.log info;
- #pid logs/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- #access_log logs/access.log main;
- sendfile on;
- #tcp_nopush on;
- #keepalive_timeout 0;
- keepalive_timeout 65;
- #gzip on;
- server {
- listen 80;
- server_name 域名;
#实现自动重写- rewrite ^(.*)$ https://$host$1 permanent;
- }
- # HTTPS server
- server {
- listen 443 ssl;
- server_name 域名;
- #charset: utf-8;
- ssl_certificate /home/wwwroot/www.chained.crt;
- ssl_certificate_key /home/wwwroot/域名.key;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- location / {
- root 网站文件夹;
- index index.html index.htm index.php;
- }
- location ~ \.php$ {
- fastcgi_buffer_size 128k;
- fastcgi_buffers 32 32k;
- root 网站文件夹;
- fastcgi_pass unix:/tmp/php-fpm.sock;
- fastcgi_index index.php;
- #include fastcgi.conf;
- fastcgi_param DOCUMENT_ROOT 网站文件夹;
- fastcgi_param SCRIPT_FILENAME 网站文件夹$fastcgi_script_name;
- include fastcgi_params;
- }
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
- }
Linux下安全证书申请以及配置到Nginx的更多相关文章
- Linux下SSL证书申请以及配置到Nginx
wget https://raw.githubusercontent.com/xdtianyu/scripts/master/lets-encrypt/letsencrypt.shchmod +x l ...
- linux免费https证书申请教程
linux免费https证书申请教程直接去阿里云 菜单有个证书服务进去有个购买证书菜单 选择免费的 然后会提示写个人资料 然后系统生成csr 然后提交审核这个时候会有份邮件 文件下载上传到你的服务器 ...
- .Neter玩转Linux系列之六:Linux下MySQL的安装、配置、使用
一.Linux安装MySQL (1)下载安装包:https://dev.mysql.com/downloads/mysql/ (2)解压并安装 命令:tar zxvf 文件名 解压完成之后,重名一下文 ...
- Linux下apache+phppgadmin+postgresql安装配置
Linux下apache+phppgadmin+postgresql安装配置 操作系统:CentOS 安装包:httpd(首选yum), php(包括php以及php-pgsql,php-mbstri ...
- Linux下Qt的安装与配置
参考资料:http://www.cnblogs.com/emouse/archive/2013/01/28/2880142.html Linux 下编译.安装.配置 QT 下载qt 这里用的是4.7. ...
- Linux 下编译、安装、配置 QT
转自Linux 下编译.安装.配置 QT 注意:编译安装耗时费力,且很容易出错,要不断调整编译参数,不推荐使用,否则这将会是一个纠结痛苦的过程. 打算做嵌入式图像处理,计划方案嵌入式Linux+Ope ...
- 在Linux下,在网络没有配置好前,怎样查看网卡的MAC地址?
在Linux下,在网络没有配置好前,怎样查看网卡的MAC地址? 使用 dmesg 与 grep 命令来实际,例如以下: [root@localhost ~]# dmesg | grep eth e10 ...
- linux下svn的安装与配置
---恢复内容开始--- linux下svn的安装与配置 Linux发行版本:CentOS6.5 1.安装subversion sudo yum -y install subversion 2.创建s ...
- linux下redis的安装及配置启动
linux下redis的安装及配置启动 标签: redisnosql 2014-10-24 14:04 19732人阅读 评论(0) 收藏 举报 分类: 数据与性能(41) wget http:/ ...
随机推荐
- SQLite在C#中的安装与操作
SQLite 介绍 SQLite,是一款轻型的数据库,用于本地的数据储存. 先说说优点,它占用资源非常的低,在嵌入式设备中需要几百K的内存就够了:作为轻量级数据库,他的处理速度也足够快:支持的的容量级 ...
- 你以为你真的会用编辑器----之Vim
Vim ----------------------- Vim下载地址:http://www.vim.org/download.php -------------------------------- ...
- 记一次Spring aop的所遇到的问题
由来 项目中需要实现某个订单的状态改变后然后推送给第三方的功能,由于更改状态的项目和推送的项目不是同一个项目,所以为了不改变原项目的代码,我们考虑用spring的aop来实现. 项目用的是spring ...
- vue-cli脚手架npm相关文件解读(9)config/index.js
系列文章传送门: 1.build/webpack.base.conf.js 2.build/webpack.prod.conf.js 3.build/webpack.dev.conf.js 4.bui ...
- JEasyPoi 2.1.4 (Jeecg订制) 版本发布,Excel 和 Word 简易工具类
JEasyPoi 2.1.4 (jeecg订制)版本发布,EasyPoi Excel 和 Word 简易工具类 easypoi 功能如同名字easy,主打的功能就是容易,让一个没见接触过poi的人员 ...
- Struts:文件上传下载
- Python初学——pickle & set
pickle 存放数据 保存和提取python运算完的结果 首先import pickle模块 定义一个字典: a_dict={'da':111,2:[23,1,4],'23':{1:2,'d':'s ...
- JavaScript实现隔行换颜色
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...
- svn: Can't convert string from 'UTF-8' to native
详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcyt227 svn 版本库中有文件是以中文字符命名的,在 Linux 下 chec ...
- Hashtable、synchronizedMap、ConcurrentHashMap 比较
详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcytp18 Hashtable.synchronizedMap.Concurren ...