安装 参考文档: https://cockpit-project.org/running.html
本系统为 AlmaLinux 9
1 2 3 4 5 6 7 sudo dnf install cockpitsudo systemctl enable --now cockpit.socketsudo firewall-cmd --add-service=cockpitsudo firewall-cmd --add-service=cockpit --permanent
创建用户 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 sudo useradd -g root usernamepasswd username vim /etc/ssh/sshd_config systemctl restart sshd vim /etc/sudoers root all=(all) all username all=(all) all chmod u-w /etc/sudoers
Podman 使用 Podman 前先对服务器进行配置国内源
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 vim /etc/containers/registries.conf unqualified-search-registries = ["docker.io" ] [[registry]] prefix = "docker.io" insecure = false blocked = false location = "docker.m.daocloud.io" [[registry.mirror]] location = "xxx.mirror.aliyuncs.com" [[registry.mirror]] location = "docker.jianmuhub.com" [[registry.mirror]] location = "dockerhub.timeweb.cloud" [[registry.mirror]] location = "docker.hlyun.org" [[registry.mirror]] location = "huecker.io" [[registry.mirror]] location = "noohub.ru" podman info
最后也要记得刷新 Cockpit 里 Podman API Service 服务
podman info
环境 PHP 相关 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 sudo dnf install -y git gcc gcc-c++ make zlib-devel bzip2 bzip2-devel readline-devel libffi-devel openssl-devel libxml2 libxml2-devel sqlite sqlite-devel libcurl libcurl-devel libpng libpng-devel libjpeg libjpeg-devel icu libicu libicu-devel oniguruma oniguruma-devel tidy libtidy-devel libxslt libxslt-devel libzip libzip-develdnf config-manager --set-enabled crb -y sudo dnf install epel-releasegit clone https://github.com/phpenv/phpenv.git /opt/phpenv export PHPENV_ROOT="/opt/phpenv" export PATH="$PHPENV_ROOT /bin:$PATH " eval "$(phpenv init -) " source ~/.bashrcphpenv version git clone https://github.com/php-build/php-build $(phpenv root)/plugins/php-build phpenv install --list phpenv install 8.1.30 phpenv versions phpenv global 8.1.30 php -v
推荐应用
https://hub.docker.com/r/jlesage/nginx-proxy-manager/tags
podman pull jlesage/nginx-proxy-manager
在 Cockpit 里 Podman 容器,创建来自docker.io/jlesage/nginx-proxy-manager:latest 镜像包容器。
<font style="color:rgb(21, 21, 21);">端口:0.0.0.0:8080 → 8080/tcp 0.0.0.0:8181 → 8181/tcp</font>
<font style="color:rgb(21, 21, 21);">环境变量:TZ=Asia/Shanghai</font>
账号密码可以看日志:info Creating a new user: admin@example.com with password: changeme
https://github.com/45Drives/cockpit-navigator
1 2 3 4 5 nmcli con show nmcli con modify <connection-UUID> ipv4.dns "8.8.8.8 8.8.4.4" nmcli con up <connection-UUID> sudo systemctl restart NetworkManagercat /etc/resolv.conf