海运的博客

使用Let's Encrypt签发的免费https证书

发布时间:February 2, 2018 // 分类: // No Comments

安装ssl证书获取工具certbot,安装前先删除request及urllib包,不然可以会出现No module named 'requests.packages.urllib3' 的错误:

pip uninstall requests -y
pip uninstall urllib3 -y
yum remove python-urllib3 -y
yum remove python-requests -y
yum install python-urllib3 -y
yum install python-requests -y
yum install certbot -y

centos8直接下载certbot,运行时会自动安装依赖:

wget https://dl.eff.org/certbot-auto

获取证书,成功后证书文件在 /etc/letsencrypt/live/haiyun.me/目录下

certbot certonly --webroot --email sss@haiyun.me --agree-tos --no-eff-email -w /var/www/www.haiyun.me -d haiyun.me -d www.haiyun.me

配置nginx:

  listen       443 default ssl ;
  server_name www.haiyun.me haiyun.me;
  index index.html index.htm index.php; 
  root  /var/www/www.haiyun.me;
  ssl_certificate /etc/letsencrypt/live/haiyun.me/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/haiyun.me/privkey.pem;
  ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers         HIGH:!aNULL:!MD5;
  ssl_prefer_server_ciphers   on;

由于Let's Encrypt的免费证书有效期为3个月,60天可以更新,使用cron定时任务自动更新证书:

00 01 * * * certbot renew --renew-hook "nginx -s reload"

吊销证书:

certbot revoke --cert-path /etc/letsencrypt/live/haiyun.me/cert.pem --key-path /etc/letsencrypt/live/haiyun.me/privkey.pem 

迁移服务器备份:

cd /etc/letsencrypt
tar zcf letsencrypt.tar.gz archive live renewal

ipip的besttrace路由跟踪工具

发布时间:February 2, 2018 // 分类: // No Comments

跟踪路由时显示IP运营商、ASN及所在位置:

yum install unzip wget -y
wget https://cdn.ipip.net/17mon/besttrace4linux.zip
unzip -d /usr/local/bin/ besttrace4linux.zip "besttrace"
chmod +x /usr/local/bin/besttrace 
#如需非root运行
setcap cap_net_raw=+eip /usr/local/bin/besttrace 
alias 'besttrace=besttrace -q 1'
echo "alias 'besttrace=besttrace -q 1'" >> /root/.bashrc 
分类
最新文章
最近回复
  • 海运: 恩山有很多。
  • swsend: 大佬可以分享一下固件吗,谢谢。
  • Jimmy: 方法一 nghtp3步骤需要改成如下才能编译成功: git clone https://git...
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...
  • 孤狼: 擦。。。。apcupsd会失联 nut在冲到到100的时候会ONBATT进入关机状态,我想想办...
  • 海运: 网络,找到相应的url编辑重发请求,firefox有此功能,其它未知。
  • knetxp: 用浏览器F12网络拦截或监听后编辑重发请求,修改url中的set为set_super,将POS...
  • Albert: 啊啊啊啊啊啊啊啊啊 我太激动了,终于好了英文区搜索了半天,翻遍了 pve 论坛没找到好方法,博...