当前位置: 首页 > news >正文

鄂尔多斯建设招投标网站百度sem认证

鄂尔多斯建设招投标网站,百度sem认证,php图片网站源码,如何制作线上投票使用 acme.sh 申请并安装 SSL 证书 本文将辅助您通过 acme.sh 工具申请并安装 Let’s Encrypt 的免费 SSL 证书。 环境准备 可访问公网的服务器。已安装 Nginx (本文以此,其它类似),并确保 80 端口可正常访问。拥有域名解析权&a…

使用 acme.sh 申请并安装 SSL 证书

本文将辅助您通过 acme.sh 工具申请并安装 Let’s Encrypt 的免费 SSL 证书。


环境准备

  • 可访问公网的服务器。
  • 已安装 Nginx (本文以此,其它类似),并确保 80 端口可正常访问。
  • 拥有域名解析权,确保域名指向服务器 IP。
  • 愿意在你的服务器上面执行五条命令

SSL 检测工具–效果图
在这里插入图片描述

步骤 1:安装 acme.sh

执行以下命令安装 acme.sh

curl https://get.acme.sh | sh

效果展示:

[root@instance-sp608fvo tmp]# curl https://get.acme.sh | sh% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
100  1032    0  1032    0     0    399      0 --:--:--  0:00:02 --:--:--   399% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
100  221k  100  221k    0     0  13834      0  0:00:16  0:00:16 --:--:-- 11956
[Thu Jun 12 12:33:51 CST 2025] Installing from online archive.
[Thu Jun 12 12:33:51 CST 2025] Downloading https://github.com/acmesh-official/acme.sh/archive/master.tar.gz
[Thu Jun 12 12:33:59 CST 2025] Extracting master.tar.gz
[Thu Jun 12 12:33:59 CST 2025] It is recommended to install socat first.
[Thu Jun 12 12:33:59 CST 2025] We use socat for the standalone server, which is used for standalone mode.
[Thu Jun 12 12:33:59 CST 2025] If you don't want to use standalone mode, you may ignore this warning.
[Thu Jun 12 12:33:59 CST 2025] Installing to /root/.acme.sh
[Thu Jun 12 12:33:59 CST 2025] Installed to /root/.acme.sh/acme.sh
[Thu Jun 12 12:33:59 CST 2025] Installing alias to '/root/.bashrc'
[Thu Jun 12 12:33:59 CST 2025] Close and reopen your terminal to start using acme.sh
[Thu Jun 12 12:33:59 CST 2025] Installing alias to '/root/.cshrc'
[Thu Jun 12 12:33:59 CST 2025] Installing alias to '/root/.tcshrc'
[Thu Jun 12 12:33:59 CST 2025] Installing cron job
[Thu Jun 12 12:33:59 CST 2025] bash has been found. Changing the shebang to use bash as preferred.
[Thu Jun 12 12:34:01 CST 2025] OK
[Thu Jun 12 12:34:01 CST 2025] Install success!

步骤 2:设置默认 CA

指定使用 Let’s Encrypt 作为默认证书颁发机构:

source ~/.bashrc
acme.sh --set-default-ca --server letsencrypt

效果展示:

[root@instance-sp608fvo ~]# source ~/.bashrc
[root@instance-sp608fvo ~]# acme.sh --set-default-ca --server letsencrypt
[Thu Jun 12 12:40:46 CST 2025] Changed default CA to: https://acme-v02.api.letsencrypt.org/directory

步骤 3:申请证书

使用 --webroot 模式申请证书。确保域名已正确解析到服务器,并且 /usr/share/nginx/html 是 Nginx 的默认根目录。

acme.sh --issue  -d 域名比如baidu.com --webroot 80端口可访问地址比如/usr/share/nginx/html

示例:

acme.sh --issue -d     test.example.com --webroot /usr/share/nginx/html

效果展示:

[root@instance-sp608fvo nginx]# acme.sh --issue  -d     test.example.com --webroot /usr/share/nginx/html
[Thu Jun 12 12:49:54 CST 2025] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Thu Jun 12 12:49:54 CST 2025] Creating domain key
[Thu Jun 12 12:49:54 CST 2025] The domain key is here: /root/.acme.sh/    test.example.com_ecc/    test.example.com.key
[Thu Jun 12 12:49:54 CST 2025] Single domain='test.example.com'
[Thu Jun 12 12:50:01 CST 2025] Getting webroot for domain='test.example.com'
[Thu Jun 12 12:50:01 CST 2025] Verifying: test.example.com
[Thu Jun 12 12:50:03 CST 2025] Pending. The CA is processing your order, please wait. (1/30)
[Thu Jun 12 12:50:08 CST 2025] Success
[Thu Jun 12 12:50:08 CST 2025] Verification finished, beginning signing.
[Thu Jun 12 12:50:08 CST 2025] Let's finalize the order.
[Thu Jun 12 12:50:08 CST 2025] Le_OrderFinalize='https://acme-v02.api.letsencrypt.org/acme/finalize/2459862082/393925191632'
[Thu Jun 12 12:50:12 CST 2025] Downloading cert.
[Thu Jun 12 12:50:12 CST 2025] Le_LinkCert='https://acme-v02.api.letsencrypt.org/acme/cert/06c810fa50377b7f67b3bafe5d77ae908659'
[Thu Jun 12 12:50:14 CST 2025] Cert success.

步骤 4:安装证书

将申请的证书安装到 Nginx,并设置自动重载配置。

acme.sh --install-cert -d <您的域名> \
--key-file /etc/pki/nginx/<您的域名>.key \
--fullchain-file /etc/pki/nginx/<您的域名>.pem \
--reloadcmd "nginx -s reload"

示例:

acme.sh --install-cert -d     test.example.com \
--key-file /etc/pki/nginx/    test.example.com.key \
--fullchain-file /etc/pki/nginx/    test.example.com.pem \
--reloadcmd "nginx -s reload"

效果展示:

[root@instance-sp608fvo nginx]# acme.sh --install-cert -d     test.example.com \
> --key-file /etc/pki/nginx/    test.example.com.key \
> --fullchain-file /etc/pki/nginx/    test.example.com.pem \
> --reloadcmd "nginx -s reload"
[Thu Jun 12 12:55:56 CST 2025] The domain 'test.example.com' seems to already have an ECC cert, let's use it.
[Thu Jun 12 12:55:56 CST 2025] Installing key to: /etc/pki/nginx/    test.example.com.key
[Thu Jun 12 12:55:56 CST 2025] Installing full chain to: /etc/pki/nginx/    test.example.com.pem
[Thu Jun 12 12:55:56 CST 2025] Running reload cmd: nginx -s reload
[Thu Jun 12 12:55:56 CST 2025] Reload successful

步骤 5:检查自动续期配置

查看 cron 任务

确保 acme.sh 的自动续期任务已添加到系统的定时任务中:

crontab -l
acme.sh --cron --home "/root/.acme.sh"

效果展示:

[root@instance-sp608fvo nginx]# crontab -l
* * * * * /opt/heyeAgent/bin/upgrade &>/dev/null
59 9 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null
[root@instance-sp608fvo nginx]# acme.sh --cron --home "/root/.acme.sh"
[Thu Jun 12 14:07:39 CST 2025] ===Starting cron===
[Thu Jun 12 14:07:39 CST 2025] Renewing: 'test.example.com'
[Thu Jun 12 14:07:39 CST 2025] Renewing using Le_API=https://acme-v02.api.letsencrypt.org/directory
[Thu Jun 12 14:07:39 CST 2025] Skipping. Next renewal time is: 2025-08-10T04:50:14Z
[Thu Jun 12 14:07:39 CST 2025] Add '--force' to force renewal.
[Thu Jun 12 14:07:39 CST 2025] Skipped     test.example.com_ecc
[Thu Jun 12 14:07:39 CST 2025] ===End cron===

如果需要强制续期,可以添加 --force 参数-未进行测试

acme.sh --renew -d <您的域名> --force

完成

至此,已成功使用 acme.sh 为您的域名申请并安装了 SSL 证书。Nginx 将自动加载新的证书,并且 acme.sh 会在证书过期前自动续期。

http://www.hkea.cn/news/988984/

相关文章:

  • 还有做网站的必要吗网站运营推广方案
  • 企业营销型网站建设厂家品牌搜索引擎服务优化
  • 学校网站建设计划怎么成为百度推广代理商
  • 普陀网站开发培训学校seo快速优化
  • 建一个商城网站多少钱免费的网站推广软件
  • 手机网站解决方案看网站搜什么关键词
  • 顺企网江西网站建设宜昌今日头条新闻
  • 坪山网站建设行业现状网页设计与制作代码成品
  • 网站建设需求文档模板下载学大教育一对一收费价格表
  • 小型网站怎样优化百度首页官网
  • 网站开发与iso9001关系百度上做推广怎么做
  • wordpress怎么设置导航镇江seo
  • 番禺建设网站服务软文写作网站
  • 有哪些专做自然风景图片的网站石首seo排名
  • 移动网站虚拟主机seo 排名 优化
  • 专业网站建设课程网站推广优化方式
  • 适合站长做的网站信息流广告投放工作内容
  • 做健身网站步骤网站建设网络公司
  • 武汉整站seo数据上云网站关键词优化怎么做的
  • 网站尾部网络seo推广
  • 建设一个公司网站需要什么知识网站网络推广优化
  • 政府高度重视网站建设怎么做网络推广
  • 自己做的网站是怎么赚钱免费ip地址网站
  • 郑州市政府网站集约化建设计划企业seo排名外包
  • 什么网站可以免费做护师题企业网站管理系统源码
  • 青岛专业餐饮网站制作国内搜索引擎排行榜
  • 域名有哪些seo站长之家
  • 建设网站有哪些关键词制作软件
  • 视频网站怎么制作网店推广的作用是什么
  • 网站栏目怎么做单独的搜索框云南疫情最新消息