yunohost学习笔记

1、linux系统安装教程

# 从YunoHost官方网站下载安装脚本,并通过bash执行该脚本,以安装YunoHost服务器。
curl https://install.yunohost.org | bash

安装完成后就可以使用ip地址访问,一共我记得做了两步操作:

  • 绑定域名(可以在cloudflare中添加一条A记录,指向这个ip地址)

  • 设置管理员的账号密码

接着就可以通过域名来访问yunohost了。

2、yunohost使用Let's Encrypt证书

yunohost一开始使用的是自签证书,因此浏览器访问时,会提示存在风险。

解决办法是登录管理员后台,

登录管理员后台

点击Domains

点击Domains

点击域名,安装Let's Encrypt证书并使用。稍等片刻,再次使用域名访问yunohost,域名前就会多了一把小锁。

安装Let's Encrypt证书

2、丰富的应用

丰富的应用

yunohost中包含了很多丰富的应用,值得我们去探索。

3、遇到的报错

以下是我遇到的第一个错误,在后台管理界面点击系统更新时,提示有签名无法被确认。

You should look for help on the forum or the chat to fix the situation, or report the bug on the bugtracker.
The following information might be useful for the person helping you:
Error: "500"

Action: "PUT" /yunohost/api/update/all

Error message:
Unable to update the cache of APT (Debian's package manager). Here is a dump of the sources.list lines, which might help identify problematic lines:
sources.list:deb http://ftp.debian.org/debian bullseye main contrib
sources.list:deb http://ftp.debian.org/debian bullseye-updates main contrib
sources.list:deb http://security.debian.org bullseye-security main contrib
sources.list.d/yunohost.list:deb [signed-by=/usr/share/keyrings/yunohost-archive-keyring.gpg] http://forge.yunohost.org/debian/ bullseye stable
sources.list.d/extra_php_version.list:deb https://packages.sury.org/php/ bullseye main

While processing the action the server said:

Fetching available upgrades for system packages...
W: GPG error: https://packages.sury.org/php bullseye InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743
E: The repository 'https://packages.sury.org/php bullseye InRelease' is not signed.

解决对策(源自new bing):

# 使用wget下载来自sury.org的PHP存储库的GPG公钥,并将其保存到/etc/apt/trusted.gpg.d/php.gpg。
# 这使得系统可以信任该PHP存储库,并允许从中安装软件包。
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

建议先解决这个报错,不然装软件时,会提示签名问题。

补充:

4、我安装的应用

  • Grav,一款CMS工具,yunhost官方文档就用的这款

  • Excalidraw,一款白板工具

  • Hugiin,一款爬虫工具

  • 待补充

! 注:yunohost安装程序卡住了,不要紧,反正我装Excalidraw和Hugiin时均卡住了,当我刷新一下后,发现都已经装完了。

5、命令

# 使用这条命令来查看YunoHost中所有服务的状态
yunohost service status
# 使用这条命令来重载nginx服务,使得新的配置更改生效
yunohost service reload nginx

6、yunohost更新证书

yunohost官方文档写明,证书会每隔三个月自动更新,但在easyvm的机器上证书并没有按时更新。

# 更新所有的域名的证书
# yunohost domain cert-install --no-checks
# yunohost domain cert-renew --no-checks
yunohost domain cert renew

7、yunohost的迁移操作