root@vultr:~# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-07-28 02:16:44 UTC; 23min ago
Docs: man:nginx(8)
Main PID: 12999 (nginx)
Tasks: 2 (limit: 1148)
Memory: 8.2M
CGroup: /system.slice/nginx.service
├─12999 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
└─13000 nginx: worker process
Jul 28 02:16:44 vultr.guest systemd[1]: Starting A high performance web server and a reverse proxy server...
Jul 28 02:16:44 vultr.guest systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Jul 28 02:16:44 vultr.guest systemd[1]: Started A high performance web server and a reverse proxy server.
nginx 状态良好。
我想用 acme 创建和编写 certificate.crt:
sudo su -l -s /bin/bash acme
curl https://get.acme.sh | sh
export CF_Key="xxxx"
export CF_Email="yyyy@yahoo.com"
CF_Key
是我在 cloudflare 中的全局 api 密钥,CF_Email
是登录 cloudflare 的注册电子邮件。
acme@vultr:~$ acme.sh --issue --dns dns_cf -d domain.com --debug 2
输出的内容太长,这里不能发,所以我上传到termbin.com,我们分享下面的链接:
https://termbin.com/taxl
请打开网页,你可以得到完整的输出信息,并检查导致错误的原因,主要有两个问题:
1.我的 nginx 服务器状态良好,acme.sh 检测不到。
2.如何设置配置文件?
[Wed Jul 28 03:04:38 UTC 2021] config file is empty, can not read CA_EAB_KEY_ID
[Wed Jul 28 03:04:38 UTC 2021] config file is empty, can not read CA_EAB_HMAC_KEY
[Wed Jul 28 03:04:38 UTC 2021] config file is empty, can not read CA_EMAIL
将密钥写入指定目录:
acme.sh --install-cert -d domain.com
--key-file /usr/local/etc/certfiles/private.key
--fullchain-file /usr/local/etc/certfiles/certificate.crt
它遇到问题:
[Tue Jul 27 01:12:15 UTC 2021] Installing key to:/usr/local/etc/certfiles/private.key
cat: /home/acme/.acme.sh/domain.com/domain.com.key: No such file or directory
签入文件/usr/local/etc/certfiles/
ls /usr/local/etc/certfiles/
private.key
没有。certificate.crt
_
那怎么修呢?/usr/local/etc/certfiles/