找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 5844|回复: 30

padavan路由Let‘s Encrypt证书并部署后,如何重启httpd进程让证书生效?

[复制链接]
为了远程访问管理路由器的安全,我摸索着通过acme.sh申请Let‘s Encrypt证书并部署好了,但是生效必须重启路由器。Let‘s Encrypt证书期限是三个月,下一次自动更新好证书后,又需要专门重启一次路由器。我想应该是httpd进程需要重启才能使证书生效。所以想在cron里加条命令让httpd进程自动重启。请问这个命令改怎么写呢?

我的恩山、我的无线 The best wifi forum is right here.
reboot 这个不能用???
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
隐形的肩膀 发表于 2019-1-31 19:52
reboot 这个不能用???

我只想重启下httpd服务,没必要因为一个证书重启路由器啊。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

好奇你是什么路由器,要刷PADAVAN还要三个月以上都不重启
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 来自手机 | 显示全部楼层
隐形的肩膀 发表于 2019-2-1 21:24
好奇你是什么路由器,要刷PADAVAN还要三个月以上都不重启

不是不重启,是换证书需要重启,万一换证书正在用网络,不可控啊。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

pkill -9 httpd

/usr/sbin/httpd -p 80
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
本帖最后由 风萧 于 2019-2-20 10:41 编辑
footlog 发表于 2019-2-17 19:21
pkill -9 httpd

/usr/sbin/httpd -p 80

非常感谢,这两个命令并成一行写成killall -9 httpd && /usr/sbin/httpd -p 80 -s 443吧。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

楼主您能分享一下怎么自动替换SSL证书吗?使用acme.sh,有什么方法把相关文件放到对的目录?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
huangegg33 发表于 2019-4-28 22:24
楼主您能分享一下怎么自动替换SSL证书吗?使用acme.sh,有什么方法把相关文件放到对的目录?

我还在试验中,Let‘s Encrypt证书有效期3个月,我看看到期acme.sh会不会自动更新证书。确定了我再写一个教程。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

正在学习如何部署申请证书,期待教程。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

请问如何部署,有具体过程吗
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
本帖最后由 风萧 于 2019-5-24 13:47 编辑
小屁孩 发表于 2019-5-23 15:59
请问如何部署,有具体过程吗
  1. cd /tmp
  2. wget https://github.com/Neilpang/acme.sh/archive/master.tar.gz #下载acme
  3. tar xzf master.tar.gz  #解压
  4. cd acme.sh-master
  5. chmod a+x acme.sh  
  6. ./acme.sh --install --home "/etc/storage/acme.sh"  #安装acme
  7. cd /etc/storage/acme.sh/  
  8. /etc/storage/acme.sh/acme.sh --home "/etc/storage/acme.sh"  #检测安装成功
  9. ./acme.sh --home "/etc/storage/acme.sh" --upgrade --auto-upgrade   #自动更新
  10. echo -e "DP_Id='xxx'\nDP_Key='xxxxx'" >>account.conf   #设置api 以dnspod为例
  11. ./acme.sh --home "/etc/storage/acme.sh" --issue --dns dns_dp -d xxx.xxx -d *.xxx.xxx   #生成xxx.xxx网站的证书
  12. ./acme.sh --home "/etc/storage/acme.sh" --installcert -d xxx.xxx --cert-file /etc/storage/https/server.crt --key-file /etc/storage/https/server.key --ca-file /etc/storage/https/ca.crt --fullchain-file /etc/storage/https/fullchain.crt --reloadcmd "killall -9 httpd && /usr/sbin/httpd -p 80 -s 443 && mtd_storage.sh save"  #安装证书 重启httpd 保存至闪存
复制代码
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
上面的代码还没有验证自动续期,不知道到期后自动续期有没有问题。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

风萧 发表于 2019-5-24 13:49
上面的代码还没有验证自动续期,不知道到期后自动续期有没有问题。

能自动续期吗?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
mikeem 发表于 2020-7-17 15:00
能自动续期吗?

可以自动续期
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-5-7 08:23

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表