sudo a2enmod http2 重新加载 Apache 配置,使得修改生效: sudo systemctl reload apache2 现在我们可以运行 Certbot 工具,配合 webroot...重新加载 Apache 配置,使得修改生效: sudo systemctl reload apache2 你现在可以使用 https:// 打开你的网站,你将看到一个绿色的锁图标。...附加--renew-hook "systemctl reload apache2"到/etc/cron.d/certbot文件,看起来就像下面这样: 运行下面的命令创建一个新的 cronjob,它将会刷新证书...reload apache2" 想要测试刷新过程,使用 certbot 命令加上--dry-run选项: sudo certbot renew --dry-run 如果没有错误提示,那就意味着刷新过程是成功的...想要了解更多关于 Certbot 脚本,浏览:Certbot 官方文档。
$ sudo apt install apache2 libapache2-mod-wsgi-py3创建mod_wsgi文件。...打开文件/etc/apache2/ports.conf进行编辑。$ sudo nano /etc/apache2/ports.conf找到该行Listen 80并将其替换为以下内容。...$ sudo snap install --classic certbot使用以下命令确保可以通过创建指向/usr/bin目录的符号链接来运行 Certbot 命令。...$ sudo ln -s /snap/bin/certbot /usr/bin/certbot运行以下命令以生成 SSL 证书。...server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name graphite.example.com
常见的反向代理服务器有 Nginx 和 Apache2。本文将详细讲解如何使用 Nginx 和 Apache2 来配置反向代理,将请求代理到不同的端口或服务器上。 1....安装 certbot: sudo apt install certbot python3-certbot-nginx 获取并配置 SSL 证书: sudo certbot --nginx -d example.com...使用 Apache2 配置反向代理 3.1 安装 Apache2 如果你的服务器上还没有安装 Apache2,首先需要安装: Debian/Ubuntu: sudo apt update sudo apt...3.4 配置 HTTPS (可选) 与 Nginx 类似,你也可以通过 certbot 获取 SSL 证书。...安装 certbot: sudo apt install certbot python3-certbot-apache 获取并配置 SSL 证书: sudo certbot --apache -d example.com
文章地址 为什么要把网站升级到HTTPS 怎样把网站升级到http/2 升级HTTPS 升级的好处如文章所说,另外这里主要用的是certbot-auto g clone https://github.com.../certbot/certbot.git cd certbot 申请建议只申请证书,nginx配置自己来配. ..../acme-v02.api.letsencrypt.org/directory ###Nginx配置并且升级HTTP2 正如原作者所说HTTP2具有太多的优势,比如多路复用,对同一个域的服务器只建立一次...要注意的是 Nginx启用http2则需要安装http_v2_module模块,并且需要openssl版本大于1.0.2,由于Chrome改变了验证http2的方式,详情可以参考此文章https://news.cnblogs.com...对于chrome最可信的调试方式是访问chrome://net-internals/#http2,如果显示你的网站使用的协议为h2,那么恭喜你开启了http2 目前https://www.itoolshub.com
/certbot-auto chmod a+x certbot-auto 自动关联到 nginx $sudo ..../certbot-auto --nginx ```bash ## 检查证书有没有过期 \$sudo ..../certbot-auto renew --dry-run ## 如果过期了就自动续订 ```bash $sudo ....,就是开启了 http2 最后重启 nginx nginx -s reload 刷新页面发现网址前面加了一把锁就表示 https 开启成功了 如何验证开启了 http2 呢 你打开要验证的网址等加载完成后...,新开一个 tab 输入 chrome://net-internals/#http2 回车 如果在列表中找到你的网址对应的 ip 就表面已经开启成功了。
apt install nginx -ysudo systemctl enable nginxsudo systemctl start nginx对于Apache:sudo apt install apache2...-ysudo systemctl enable apache2sudo systemctl start apache2配置防火墙允许HTTP和HTTPS流量:sudo ufw allow 80/tcpsudo...certbot python3-certbot-nginx -y # 对于Nginx# 或者sudo apt install certbot python3-certbot-apache -y #...以下是一些重要的安全配置:Nginx SSL配置优化:server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name...不同DNS提供商有相应的Certbot插件,如certbot-dns-cloudflare、certbot-dns-route53等。
首先下载certbot的自动安装脚本: wget https://dl.eff.org/certbot-auto chmod a+x certbot-auto 然后,运行如下命令: $ sudo ....= "https") { return 301 https://$host$request_uri; } # managed by Certbot 这里建议配置 http2,这要求 Nginx 版本要大于...HTTP2 具有更快的 HTTPS 传输性能,非常值得开启(关于性能你可以看一下这篇文章)。...需要开启HTTP/2其实很简单,只需要在 nginx.conf 的 listen 443 ssl; 后面加上 http2 就好了。...如下所示: listen 443 ssl http2; # managed by Certbot ssl_certificate /etc/letsencrypt/live/coolshell.cn/
,通过 Certbot 工具来自动化获取和安装证书。...Certbot 会自动验证你的域名,并生成 SSL 证书。3....编辑 Apache 配置文件:编辑位于 /etc/apache2/sites-available/ 目录下的虚拟主机文件,例如 yourdomain.com.conf,并确保有以下 SSL 相关的配置:... 启用 SSL 模块: sudo a2enmod ssl 重启 Apache: sudo systemctl restart apache2 4....你也可以手动运行以下命令来测试续期: sudo certbot renew 报错处理Certbot failed to authenticate some domains 重新运行 Certbot:
使用以下命令安装:sudo apt install apache2 -y安装完成后,启动 Apache 服务:sudo systemctl start apache2为确保 Apache 在重新启动后自动启动...:sudo systemctl enable apache2你可以通过在 Web 浏览器中导航到服务器的 IP 地址来验证 Apache 是否正在运行。...为使其首先提供 index.php,编辑 dir.conf:sudo nano /etc/apache2/mods-enabled/dir.conf将 index.php 移到列表的最前面,使其看起来像这样...要使用它,首先安装 Certbot:sudo apt install certbot python3-certbot-apache -y然后,请求证书:sudo certbot --apache按照屏幕上的说明操作...设置完成后,Certbot 将自动更新你的证书。结论在 Ubuntu 上设置 Web 服务器是一件简单的事情,特别是当你将该过程分解为可管理的步骤时。
获取certbot wget https://dl.eff.org/certbot-auto chmod a+x certbot-auto 安装nginx yum -y install nginx 生成证书.../certbot-auto certonly --standalone --email syf@alexorz.com --agree-tos -d alexorz.com 查看生成的证书 ll /etc.../archive/alexorz.com/fullchain1.pem 在nginx配置证书 server { listen 443 ssl http2 default_server...; listen [::]:443 ssl http2 default_server; server_name _; root
本教程将用/etc/apache2/sites-available/example.com.conf作示例。...第1步 - 安装Certbot 使用Let's Encrypt获取SSL证书的第一步是在服务器上安装Certbot软件。 在撰写本文时,默认情况下,Debian软件存储库中不提供Certbot。...如果您遵循Apache安装教程中的虚拟主机设置步骤,那么您应该已经在/etc/apache2/sites-available/example.com.conf为您的域设置一个VirtualHost块,并且已经正确设置了该...要检查,请使用nano或其他您喜欢的文本编辑器打开您的域的虚拟主机文件: sudo nano /etc/apache2/sites-available/example.com.conf 找到现有的ServerName...配置文件的语法正确后,重新加载Apache以加载新配置: sudo systemctl reload apache2 Certbot现在可以找到正确的VirtualHost块并进行更新。
$ sudo add-apt-repository ppa:certbot/certbot $ sudo apt-get update $ sudo apt-get install certbot 对于...return 301 https://$host$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2...; 表示监听443端口,并开启http2,当然也可以不开启。...如果开启了nginx的HTTP2配置,也会看见浏览器访问的开发者工具中,显示的h2的协议。...对于1.10.1以上的版本,则默认安装的就能开启http2的功能。 更新证书 letsencrypt的证书权威且安全,就是有效期只有90天。过期前需要续时间。好在certbot提供的工具足够简单。
证书申请安装 在 certbot 申请证书,选好了代理和操作系统一个,照着 guide 操作。...wget https://dl.eff.org/certbot-auto sudo mv certbot-auto /usr/local/bin/certbot-auto sudo chown root.../usr/local/bin/certbot-auto sudo chmod 0755 /usr/local/bin/certbot-auto 接着自动安装,中途退出了: sudo /usr/local.../bin/certbot-auto --nginx ......改进 HTTP2 在 nginx 中配置打开 http2: listen 443 ssl http2; 可是在修改完毕,重新加载 nginx 的时候,它提示 http2 不认识,于是就检查了,发现是 nginx
安装 yum install epel-release -y yum install certbot -y 配置 certbot certonly --webroot -w /www/html -d suncle.me...可以通过运行:certbot renew --dry-run 来测试自动生成是否能够正常运行。...listen 443 ssl http2; server_name www.suncle.me suncle.net blog.suncle.net; #告诉浏览器当前页面禁止被...suncle.me/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/suncle.me/privkey.pem; listen 443 ssl http2...或者不采用http2协议,直接listen 443 ssl即可 保存配置,检查是否报错,重启Nginx /usr/local/nginx/nginx -t /usr/local/nginx/nginx
证书来源: Let’s Encrypt 站点支持:https://certbot.eff.org/ VPS环境:Ubuntu 16.04 Web服务器:Apache2 下面是配置流程,比较简单,按照官网的操作就可以进行了...sudo apt-get update $ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:certbot.../certbot $ sudo apt-get update $ sudo apt-get install python-certbot-apache 安装过程中一路yes和enter就可以了。...2.安装完成之后,开始使用cerbot $ sudo certbot –apache 配置成功,你的https已经可以使用了。 3.cerbot的证书是时效性的,接下来还要开启证书的自动更新功能。...$ sudo certbot renew –dry-run 运行如下命令,启动证书的自动更新。好了一切配置完成。 你可以愉快的使用https网站了。
sudo nano /etc/apache2/sites-available/my_domain.conf比如我这里是:sudo nano /etc/apache2/sites-available/wumakaifa.com.conf...sudo a2enmod rewrite && sudo a2enmod rewrite && sudo apache2ctl configtest && sudo systemctl restart apache2...第七步:安装SSL证书返回到VPS的控制台,首先我们要安装Certbot:sudo apt install certbot python3-certbot-apache -y接下来,我们需要调整防火墙规则...:sudo ufw allow 'Apache Full' && sudo ufw delete allow 'Apache'然后,启动Certbot来获取SSL证书:sudo certbot --apacheCertbot...Deploying certificateSuccessfully deployed certificate for wumakaifa.com to /etc/apache2/sites-available
安装客户端软件 如果你的操作系统包含了一个certbot的安装包,从这里安装它 ,然后使用相应的certbot命令。如果没有的话,则可以使用我们提供的cert-auto包装器脚本快速的获取一份。...$ git clone https://github.com/certbot/certbot $ cd certbot $ ..../certbot-auto --help certbot-auto 与certbot命令拥有相同的命令行参数;它会安装所有的依赖并且自动更新 Certbot 的代码(这个过程下载的文件比较大,因此比较慢...-w /var/www/thing -d thing.is,m.thing.is 如果你的证书安装在本地服务器,则一旦certonly命令执行完成,你需要重载服务器的配置文件(例如,对于apache2...服务器来说执行server apache2 reload命令)。
Certbot 是一个自动化工具,可以帮助你申请和管理 Let’s Encrypt SSL 证书。以下是如何使用 Certbot 申请和管理 Let’s Encrypt 证书的详细步骤: 1....安装 Certbot 和 Nginx 插件 首先,你需要安装 Certbot 和适用于 Nginx 的插件。...sudo apt update sudo apt install certbot python3-certbot-nginx 2....使用 Certbot 申请证书 Certbot 提供了一个简单的命令来自动配置 SSL 证书并更新 Nginx 配置文件。...www.example.com; return 301 https://$host$request_uri; # 强制 HTTP 重定向到 HTTPS } server { listen 443 ssl http2