分类 玩客云相关 下的文章

最新烧录版下载

https://github.com/hzyitc/armbian-onecloud/releases/download/ci-20250604-151846-UTC/Armbian-unofficial_25.08.0-trunk_Onecloud_bookworm_current_6.12.32.burn.img.xz

烧录完成后的操作

直接apt update会出错

错误信息如下:
“命中:1 http://security.debian.org bookworm-security InRelease

命中:2 http://deb.debian.org/debian bookworm InRelease

命中:3 https://mirrors.aliyun.com/docker-ce/linux/debian bookworm InRelease

获取:4 https://github.armbian.com/configng stable InRelease [5,467 B]

命中:5 http://deb.debian.org/debian bookworm-updates InRelease

点击数:7 http://deb.debian.org/debian bookworm-backports InRelease

错误:4 https://github.armbian.com/configng stable InRelease

由于没有公钥,无法验证下列签名: NO_PUBKEY 93D6889F9F0E78D5 NO_PUBKEY 1EB30FAF236099FE

命中:6 https://xogium.performanceservers.nl/apt bookworm InRelease

正在读取软件包列表... 完成

正在分析软件包的依赖关系树... 完成

正在读取状态信息... 完成

所有软件包均为最新。

W: 校验数字签名时出错。此仓库未被更新,所以仍然使用此前的索引文件。GPG 错误:https://github.armbian.com/configng stable InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 93D6889F9F0E78D5 NO_PUBKEY 1EB30FAF236099FE

W: 无法下载 https://github.armbian.com/configng/dists/stable/InRelease 由于没有公钥,无法验证下列签名: NO_PUBKEY 93D6889F9F0E78D5 NO_PUBKEY 1EB30FAF236099FE

W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。”

使用谷歌的双子座AI来解决

https://gemini.google.com/app/6869542018d8b5d3?hl=zh

解决办法

进入该网址https://github.com/armbian/configng/把页面汉化,即可找到答案。
该工具针对Armbian Linux进行了优化,但理论上,它也适用于任何基于 systemd、兼容 APT 的 Linux 发行版 - 包括 Linux Mint、Elementary OS、Kali Linux、MX Linux、Parrot OS、Proxmox、Raspberry Pi OS 等。

1,添加 Armbian 密钥 + 存储库并安装工具:
wget -qO - https://apt.armbian.com/armbian.key | gpg --dearmor | \
sudo tee /usr/share/keyrings/armbian.gpg > /dev/null
cat << EOF | sudo tee /etc/apt/sources.list.d/armbian-config.sources > /dev/null
Types: deb
URIs: https://github.armbian.com/configng
Suites: stable
Components: main
Signed-By: /usr/share/keyrings/armbian.gpg
EOF
sudo apt update
sudo apt -y install armbian-config

2,执行armbian-config
Armbian 配置已随 Armbian 预装。首先,打开终端或通过 SSH 登录,然后运行:

armbian-config

虽然现在还不懂armbian-config的作用,但是确实可以解决问题。

1. 确认 Docker 使用了代理

你 curl 用的是代理:

Uses proxy env variable https_proxy == 'http://192.168.222.155:17890'
但是 Docker 默认不会继承系统环境变量,你需要专门配置 Docker 代理。

设置 Docker 的代理环境变量:
创建目录(如果不存在):

sudo mkdir -p /etc/systemd/system/docker.service.d
然后创建文件:

sudo nano /etc/systemd/system/docker.service.d/http-proxy.conf
填入以下内容(根据你的代理地址替换):

[Service]
Environment="HTTP_PROXY=http://192.168.222.155:17890"
Environment="HTTPS_PROXY=http://192.168.222.155:17890"
Environment="NO_PROXY=localhost,127.0.0.1,::1"
保存退出后,刷新 systemd 并重启 Docker:

sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl restart docker
然后测试拉取镜像:

docker pull hello-world

2. Docker 登录(可选但推荐)

有些镜像需要认证,比如你反复请求后可能会被限速。

执行:

docker login
输入 Docker Hub 的用户名和密码或 token。

3. 国内镜像加速器(推荐)

为避免 Docker Hub 网络不稳定的问题,可以继续使用国内镜像源。

编辑 /etc/docker/daemon.json:

{
"registry-mirrors": [

"https://mirror.baidubce.com",
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com"

]
}
然后重启 Docker:

sudo systemctl daemon-reexec
sudo systemctl restart docker

一步一步排查:

  1. 确认网络连通性
    curl -v https://registry-1.docker.io/v2/
    看是否能够连通。如果卡住、超时或者报错,说明问题是网络层的问题。
  2. 是否被代理、GFW 阻断?
    如果你在中国大陆,访问 Docker Hub 很可能是被墙了。

✅ 解决办法:配置镜像加速器
编辑 /etc/docker/daemon.json,添加如下内容:

{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
或者用阿里云/网易的镜像加速器,比如:

{
"registry-mirrors": ["https://<你的阿里云ID>.mirror.aliyuncs.com"]
}
然后重启 Docker:

sudo systemctl daemon-reexec
sudo systemctl restart docker

  1. 测试 DNS 是否正常解析
    nslookup registry-1.docker.io
    或者:
    dig registry-1.docker.io
    如果没有 IP 地址返回,说明 DNS 配置可能有问题。

✅ 解决方法:设置公共 DNS
编辑 Docker 的 DNS 配置 /etc/docker/daemon.json:
{
"dns": ["8.8.8.8", "1.1.1.1"]
}
然后重启 Docker。

  1. 测试是否能 ping Docker Hub
    ping registry-1.docker.io
    注意: 一些 Docker Hub 域名不响应 ping,这是正常的,但如果出现 Network is unreachable 或者 Name or service not known,就说明网络或 DNS 出问题。
  2. 尝试登录
    docker login
    可以规避匿名用户被限速的情况。
  3. 确认系统时间正确
    系统时间不对可能导致 TLS 握手失败:

如不正确可同步:

sudo ntpdate time.windows.com

  1. 如果仍不行
    你也可以尝试国内镜像服务,比如:

阿里云容器镜像服务(可免费申请)
网易云镜像加速器
DaoCloud 镜像加速器

一、docker官方提供的一键安装docker命令

1、一键安装命令

wget -qO- https://get.docker.com | bash -s docker --mirror Aliyun

2、安装完成后需要执行

systemctl daemon-reload

systemctl restart docker

3、证明安装完成,docker 的命令如下:

systemctl start docker # 启动docker
systemctl stop docker # 停止docker
systemctl status docker # 查看docker状态
systemctl restart docker # 重新启动docker

1、安装nginx

输入apt-get -y install nginx回车

apt-get -y install nginx
然后就安装成功了

输入玩客云ip地址我这里是:10.0.0.109

2、安装php最新版的armbian包24.5默认安装的是php8.2

复制回车远行,然后等

apt install -y php php-fpm php-mysql php-gd php-curl php-mbstring php-xml php-xmlrpc php-json php-zip php-intl php-xsl

php -v查询版本号

3、安装Mariadb

apt install -y mariadb-server
mysql -v查询版本号

4.配置环境

4.1配置nginx

首先输入vim /etc/nginx/sites-enabled/default,打开nginx配置文件

vim /etc/nginx/sites-enabled/default
在44行前面添加index.php,56行57行和60行以及63行去除行头#号(注意这里的默认的php7.4要改为php8.2)注意这里如果用putty登录修改会出错,可能是编码的问题。

输入nginx -t

root@aml-s812:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
表示没有问题

重新启动nginx

service nginx restart
新建测试页面文件(后面记得删除)

echo "<?php phpinfo(); ?>">/var/www/html/info.php
浏览器打开ip/info.php

就可以看到php的相关信息了

4.2配置Mariadb
4.2.1安全设置
输入mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

  • In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank,so you should just press enter here.
    Enter current password for root (enter for none):
    注意:建议所有人都运行此脚本的所有部分服务器在生产中使用!请仔细阅读每一步!为了登录MariaDB以确保其安全,我们需要当前根用户的密码。如果你刚刚安装了MariaDB您尚未设置根密码,密码将为空,所以你应该在这里按回车键。输入root用户的当前密码(输入无):我们刚刚安装,没有密码直接回车
  • Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation.You already have a root password set, so you can safely answer 'n'.Change the root password? [Y/n]
    设置root密码可以确保任何人都无法登录MariaDB未经适当授权的root用户。您已经设置了根密码,因此可以安全地回答“n”。
    更改根密码?[是/否]
    输入y设置一个简单而且你记得住密码 我这里是P@ssW0
  • By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.Remove anonymous users? [Y/n]
    默认情况下,MariaDB安装有匿名用户,允许任何人登录MariaDB而无需为其创建用户帐户他们这仅用于测试和安装再平稳一点。你应该在搬进公寓前把它们取下来生产环境。
    删除匿名用户?[是/否]
    y 删除就完了
  • Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n]
    通常,root用户只能从“localhost”连接。这确保有人无法从网络中猜到根密码。
    不允许根用户远程登录?[是/否]
    n方便修改
  • By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.Remove test database and access to it? [Y/n]
    默认情况下,MariaDB附带一个名为“test”的数据库,任何人都可以使用通道这也仅用于测试,应移除在进入生产环境之前。
    删除测试数据库并访问它?[是/否]
    n没有用直接删除
  • Reloading the privilege tables will ensure that all changes made so far will take effect immediately.
    Reload privilege tables now? [Y/n]
    重新加载特权表将确保迄今为止所做的所有更改将立即生效。
    现在重新加载特权表吗?[是/否]
    y

4.2.2 账户设置

  • 直接输入mysql直接登录
    mysql
  • 查询用户表
    select User,host from mysql.user;
  • 使用mysql数据库
    use mysql;
    GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
    添加一个可以从任何地址登录的root账户密码建议复杂一点
    mysql用户想连到mysql,需要使用grant命令给用户授权,有一个简单的办法,可以使用grant ALL privileges 命令给用户授予所有权限, 你想myuser使用mypassword从任何主机连接到mysql服务器的话。
    主要使用:GRANT ALL PRIVILEGES ON . to 'root'@'%'; 命令授权.
  • -grant给root使用root密码从任何主机连接到mysql服务器。
    GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
  • -或者
    GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'root';
    FLUSH PRIVILEGES;
  • -grant给root用户授予操作mysql所有数据库的所有权限

文链接:h[ttps://blog.csdn.net/weixin_32848231/article/details/113902462](https://blog.csdn.net/weixin_32848231/article/details/113902462)

ALTER USER 'root'@'%' IDENTIFIED BY '6166b2002fdcb5df';
ALTER USER 'root'@'localhost' IDENTIFIED BY 'P@ssW0rd';
update user set plugin = 'mysql_native_password' where user = 'root';

flush privileges;

5、自动挂载u盘,把typecho安装到u盘

修改/etc/rc.local添加挂载u盘命令,给该文件执行权限。

6、nginx修改web目录到u盘目录

nano /etc/nginx/sites-enabled/default,打开nginx配置文件

修改server块为:

root /mnt/sda/web/typecho;

挂在u盘时需要更改U盘的系统文件格式为ext4,否则不支持修改权限

重新加载Nginx配置以使更改生效,通常使用以下命令:sudo nginx -s reload

或者重启Nginx服务:sudo systemctl reload nginx

或者在不同的系统中:sudo service nginx reload

7、安装typecho

8、安装过程出错,问题解决:

8.1、安装程序时无法连接数据库

在把程序放到目录下,进行安装的时候,将数据库的密码输入正确后,无法进行安装

这个时候处理方式就是手动创建一个typecho的数据库即可解决

8.2、无法登录后台

Nginx服务器点击前台链接或者后台登录时出现404, not found

官方给的解决方式是一般的出现这种情况时,nginx.conf里的location设置都是类似这样

location ~ .*\.php$

要支持pathinfo,要改成

location ~ .*\.php(\/.*)*$

一个比较好的typecho博客网址:https://yangwenqing.com/