命令行参考
llstack-ctl
Section titled “llstack-ctl”LLStack 提供统一的 llstack-ctl 命令行工具,覆盖面板的所有管理操作。安装后自动配置到 /usr/local/bin/llstack-ctl。
llstack-ctl <command> [subcommand] [options]llstack-ctl version # 查看版本llstack-ctl help # 查看帮助site — 站点管理
Section titled “site — 站点管理”# 列出所有站点llstack-ctl site list
# 创建站点llstack-ctl site create --domain example.com --user webuser --php php83
# 删除站点(需确认)llstack-ctl site delete --domain example.com --remove-files --yesphp — PHP 管理
Section titled “php — PHP 管理”# 列出已安装版本llstack-ctl php list
# 安装 PHP 版本llstack-ctl php install --version 84
# 卸载 PHP 版本(需确认)llstack-ctl php uninstall --version 74
# 安装扩展llstack-ctl php ext --version 83 --ext redis
# 修改配置llstack-ctl php config --version 83 --key upload_max_filesize --value 64Mdb — 数据库管理
Section titled “db — 数据库管理”支持 MariaDB、MySQL、Percona、PostgreSQL。
# 列出数据库llstack-ctl db list
# 创建数据库llstack-ctl db create --name myapp --engine mariadb --user myuser --password 'SecurePass!'
# 删除数据库(需确认)llstack-ctl db delete --name myapp --engine mariadb --yes
# 导出llstack-ctl db export --name myapp --engine mariadb > backup.sql
# 导入llstack-ctl db import --name myapp --engine mariadb --file backup.sql
# 克隆llstack-ctl db clone --source myapp --target myapp_copy --engine mariadb
# 维护llstack-ctl db maintenance --name myapp --engine mariadb --action optimize
# 查看进程llstack-ctl db processes mariadbredis — Redis/Valkey 管理
Section titled “redis — Redis/Valkey 管理”自动检测 Redis 或 Valkey(EL10 兼容)。
# 创建实例llstack-ctl redis create --user webuser --password 'RedisPass!' --maxmemory 128
# 查看状态llstack-ctl redis status --user webuser --password 'RedisPass!'
# 控制实例llstack-ctl redis control --user webuser --action restart
# 删除实例(需确认)llstack-ctl redis delete --user webuser --yeswordpress — WordPress 管理
Section titled “wordpress — WordPress 管理”# 列出 WP 实例llstack-ctl wordpress list
# 扫描系统中的 WP 安装llstack-ctl wordpress scan
# 安装 WordPressllstack-ctl wordpress install \ --path /home/webuser/public_html/example.com \ --url https://example.com \ --admin-email admin@example.com \ --admin-password 'AdminPass!' \ --db-name wp_example \ --db-user wp_user \ --db-password 'DbPass!'backup — 备份管理
Section titled “backup — 备份管理”# 列出最近备份llstack-ctl backup list
# 创建备份llstack-ctl backup create --site example.com --type full
# 恢复备份(需确认)llstack-ctl backup restore --path /opt/llstack/backups/example.com_full_1234.tar.gz
# 运行 restic 自动备份llstack-ctl backup snapshotssl — SSL 证书
Section titled “ssl — SSL 证书”# 签发 Let's Encrypt 证书llstack-ctl ssl issue --domain example.com
# 批量续期llstack-ctl ssl renewuser — 用户管理
Section titled “user — 用户管理”# 列出面板用户llstack-ctl user list
# 创建系统用户llstack-ctl user create --username newusersystem — 系统管理
Section titled “system — 系统管理”# 系统状态(CPU/内存/磁盘/服务)llstack-ctl system status
# 配置重建(修复配置漂移)llstack-ctl system repair --component all
# 重启服务(白名单:lshttpd/mariadb/mysqld/postgresql/redis/valkey/llstack)llstack-ctl system restart lshttpd
# cgroup 资源查看llstack-ctl system cgroup --user webuser
# 服务升级检查llstack-ctl system upgrade-check mariadb- 密码安全传递 — 所有密码通过临时文件(
mktemp+chmod 600)传递给脚本,EXIT trap 自动清理 - 破坏性操作确认 — delete/restore/repair/uninstall 操作需交互确认(
--yes跳过) - 未知参数拒绝 — 防止拼写错误导致意外操作
- 服务重启白名单 —
system restart只允许已知服务 - 非零退出码 — 所有错误返回 exit 1,适合脚本集成
| 路径 | 说明 |
|---|---|
/usr/local/bin/llstack-ctl | CLI 入口(symlink) |
/opt/llstack/scripts/llstack-ctl | CLI 实际文件 |
/opt/llstack/ | 面板安装目录 |
/opt/llstack/backend/ | Flask 后端(Nuitka 编译) |
/opt/llstack/web/dist/ | 前端静态文件 |
/opt/llstack/scripts/ | Shell 脚本 |
/opt/llstack/data/llstack.db | 面板 SQLite 数据库 |
/usr/local/lsws/ | LiteHttpd 安装目录 |
/usr/local/lsws/conf/vhosts/ | 虚拟主机配置 |