6_How to enable HTTPs on Your Website in 2 minutes_
地址:https://www.codewithharry.com/blogpost/get-https-ubuntu-using-lets-encrypt/
How to get free https on your site using Let's Encrypt SSL on Ubuntu 20.04
Have you ever seen that green padlock at the top in the URL bar which reads "Connection is secure"? In this post, we will discuss how to enable HTTPS for your website hosted on ubuntu 20.04. We will use let's encrypt for this purpose which is a non-profit certificate authority used to get SSL certificates for your website.
Not only that we can use certbot to automatically renew these certificates which makes it a one-time task for a single domain.
We will assume that you already have a domain pointed to the IP address of your VPS. Follow the steps below:
Step 1 - Install lets encrypt
Execute the following commands to install let's encrypt on ubuntu:
Step 2 - Allow HTTPS through the firewall and configure apache2 virtual hosts
If you are using apache, enter the following commands to allow apache2 over the firewall:
Step 3 - Obtain an SSL certificate
Run the following command to obtain an SSL certificate
This command shows you some prompts and finally installs an SSL certificate on the domain of your choice.
Step 4 - Test the auto-renewal process
Certbot, by itself, takes care of the auto-renewal process of your SSL certificate. You can test the auto-renewal of your SSL certificate by firing the following commands:
You can even dry run the auto-renewal by using the below command:
Hope this guide was helpful for you to install an SSL certificate on your server. Happy coding!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现