debian11+caddy/nginx+php8.1

很久未有更新,在此深刻道歉!

最近一年多来世界上发生了太多事情,大家都不易。covid19影响在持续,战火依旧在燃烧。关于电脑互联网以及coding方面,也有不少事情发生。win11已经逐步占据主流,微软也会停止win10的支持。关于老旧电脑由于硬件限制只有近2年的电脑才可自动升级成功,但不是说旧电脑不可能升级(太差的还是不要升级了,转不动)。更新到win11的办法我会抽空写一下,不过win10继续用也没多大问题。关于linux vps搭建方面,今天简单分享一下。

debian是我最喜欢的linux系统,作为外行的我来看,一是debian比较精炼,二是功能足够。debian11已经发布,替代了短命的debian10(据说bug多)。那么在debian11上搭建常用的服务器环境如何install呢

继续阅读“debian11+caddy/nginx+php8.1”

旧debian更新源

debian在今年8月已经发布了debian11,而很多主机的版本还是10.3,在更新是会提示找不到源无法更新,可以修改/ect/apt/source.list里面的源地址来继续更新。(这里是阿里云的源)

deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

除了系统,PHP,mariadb这些程序在使用一段时间后也可能会出现过期无法更新的问题。需要使用apt-key来更新OpenPGP key. apt-key的选项有:

apt-key add <file>          - add the key contained in <file> ('-' for stdin)
  apt-key del <keyid>         - remove the key <keyid>
  apt-key export <keyid>      - output the key <keyid>
  apt-key exportall           - output all trusted keys
  apt-key update              - update keys using the keyring package
  apt-key net-update          - update keys using the network
  apt-key list                - list keys
  apt-key finger              - list fingerprints
  apt-key adv                 - pass advanced options to gpg (download key)

首先需要在官网上去下载最新的GPG文件,再用上面这些来添加进souce.list里面。mariaDB最新的版本是10.7 ,在这里下载更新

关于key失效也可以看这里。关于dirmngr文件夹找不到,可以看这里debian上的PHP版本更新看这里,包括GPG文件。

caddy2

最近半年多对caddy这个小巧的服务器有点入迷,可是caddy2推出时有点搞不懂,现在caddy2已经发展到ver2.11了,官方也是主推caddy2,折腾了一段时间总算成功运行了。这里也不想写什么教程了,就总结下肤浅的经验体会吧!

继续阅读“caddy2”

再次搬家

出于节省成本的考量,决定舍弃租用了多年的稳定的changeip家的服务器(40刀/年 1G内存),启用吃灰多年的vultr。


这次搬家总体较为顺畅

  • 数据部分用服务器间wget传,文件直接压缩和解压缩
tar -cvf xxx.tar /dir
tar -xvf xxx.tar
mv xxx.tar /dir
mysqldump -u root -ppasswd --all-databases > db.sql
>mysql source db.sql

SSL方面还是一如既往的let encrypt,既然是免费的,不建议将证书移过来的做法而是要新安装。注意申请的时候要停止web服务器。https://www.vmvps.com/letsencrypt-life-time-free-ssl-certificate-installation-and-usage-tutorial.html