Oracle云服务器下配置免费ssl证书(Let's Encrypt)

Oracle云的web服务器使用的是nginx,在打开相应端口后,就可以访问网页。如果使用HTTPS,还需要安装配置ssl证书,目前免费的证书是Let's Encrypt,三个月需要更新一次。

ubuntu下的Let's Encrypt证书申请是通过certbot维护,现在已经非常简单,不再像原先那么繁琐。

安装certbot

#  sudo apt install certbot

初次安装证书

# certbot certonly

第一次申请的时候,会要求输入邮箱,这是为了到期邮件提醒。然后选择证书种类。

How would you like to authenticate with the ACME CA?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

1: Spin up a temporary webserver (standalone)

2: Place files in webroot directory (webroot)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Select the appropriate number [1-2] then [enter] (press 'c' to cancel):

因为是安装在服务器中,所以选择2

Please enter in your domain name(s) (comma and/or space separated) (Enter 'c'

to cancel):

然后让输入域名。

Input the webroot for img.aaaa.net: (Enter 'c' to cancel):

输入域名所属网站所在的目录,如/var/www/html/img,其中域名必须已经配置完成而且目录已经建立,在此基础上,免费证书就申请成功了。

证书下载在 /etc/letsencrypt/live/相应域名目录下。

更新证书

 Let's Encrypt 签发的 SSL 证书有效期只有 90 天,证书到期前会受到邮件通知,可以通过certbot更新,更新前需要停止nginx运行。

# certbot renew

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容