Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set up Let's Encrypt SSL on Ubuntu 18.04and 16.04LTS

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Today, I will talk to you about how to set up Let's Encrypt SSL on Ubuntu 18.04and 16.04LTS. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something from this article.

Step 1: prerequisites

Before you begin to complete this task, assume that you already have:

Use sudo privilege shell to access and run the Ubuntu system. The domain name is registered and points to the public IP address of the server. In this article, we use example.com and

Www.example.com, which points to our server. Run a Web server configured with virtualhost (for example, .com) and www.example.com on port 80.

Step 2: install the Let's Encrypt client

Download the certbot-auto,Let's Encrypt client and save it in the / usr/sbin directory. Use the following command to do this.

$sudo wget https://dl.eff.org/certbot-auto-O / usr/sbin/certbot-auto$ sudo chmod axix / usr/sbin/certbot-auto

Step 3: obtain the SSL certificate

Let's Encrypt automatically performs strong domain verification and verifies domain ownership. After the certification authority (CA) verifies the authenticity of the domain, the SSL certificate is issued.

$sudo certbot-auto certonly-standalone-d example.com-d www.example.com

The above command prompts for an email address that is used to send email alerts related to SSL renewal and expiration. In addition, there are some problems. When finished, it will issue a SSL certificate and create a new virtual host profile on your system.

Step 4: check the SSL certificate

If all goes well. The new SSL will be released in the following location. Navigate to the directory below and view the file.

Cd / etc/letsencrypt/live/example.comls

File list:

Cert.pem chain.pem fullchain.pem privkey.pem

Step 5: configure the SSL virtual host

Use the following configuration for Apache and Nginx Web servers. Edit the virtual host configuration file and add the following certificate entry.

Nginx:

Ssl on;ssl_certificate / etc/letsencrypt/live/example.com/fullchain.pem;ssl_certificate_key / etc/letsencrypt/live/example.com/privkey.pem

Apache:

SSLEngine onSSLCertificateFile / etc/letsencrypt/live/example.com/cert.pemSSLCertificateKeyFile / etc/letsencrypt/live/example.com/privkey.pemSSLCertificateChainFile / etc/letsencrypt/live/example.com/chain.pem

Step 6: configure SSL automatic renewal

Finally, configure the following jobs on the server crontab to automatically renew the SSL certificate as needed.

0 2 * sudo / usr/sbin/certbot-auto-Q renew

After reading the above, do you have any further understanding of how to set up Let's Encrypt SSL on Ubuntu 18.04and 16.04LTS? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report