Ubuntu 22.04 安装 Limbas 7.1.15 指南

Ubuntu 22.04.5 从零安装 Limbas 7.1.15 全流程实测:Apache 2.4.52 + PHP 8.3.36(ondrej PPA)+ PostgreSQL 14.24,方案 A 官方 Release tar 包(主线)与方案 B git 源码 + composer 依赖装配(备用),含 sha256 校验、vhost 配置、管理员口令初始化、systemd 托管与登录验证回显

Limbas低代码自托管PHP 应用PostgreSQL表单构建2026/11/03

Ubuntu 22.04 安装 Limbas 7.1.15 指南

目标:在 Ubuntu 22.04.5 LTS 服务器上从零部署 Limbas(openlimbas)7.1.15,得到可登录、可管理的低代码数据库应用。已在真实服务器 limbas-server(10.89.59.2,Apache 2.4.52 + PHP 8.3.36 + PostgreSQL 14.24,Web 端口 80,安装路径 /opt/limbas/openlimbas-7.1.15,数据库 limbasdb)实测通过。软件背景与选型见《Limbas 介绍与选型指南》。

一、环境信息

  • 操作系统:Ubuntu 22.04.5 LTS(x86_64),主机名 limbas-server,IP 10.89.59.2
  • Web 服务器:Apache 2.4.52-1ubuntu4.25(mpm_prefork + libapache2-mod-php8.3,mod_php 形态)
  • PHP:8.3.36(PPA ondrej/php;Ubuntu 22.04 自带 8.1 不满足要求,见第二章)
  • 数据库:PostgreSQL 14.24-0ubuntu0.22.04.1(Ubuntu 默认源),库 limbasdb,应用账号 limbas / q1w2e3r4
  • 应用:openlimbas 7.1.15(GPL-2.0),安装目录 /opt/limbas/openlimbas-7.1.15,DocumentRoot 为 public/,监听 80
  • 演示管理员:admin / q1w2e3r4

二、前置条件

安装前确认以下条件(均为本文实测环境的真实约束):

  1. PHP ≥ 8.2:composer.json 实测第 9 行为 "php": "^8.2",而 Ubuntu 22.04 官方源只提供 PHP 8.1,必须添加 ondrej/php PPA 安装 8.3,否则 Limbas 7.x 无法运行;
  2. 必需 PHP 扩展(composer.json require 实测清单):ctype curl dom gd imagick iconv imap mbstring odbc openssl pdo simplexml soap sockets zlib + pdo_pgsql/pgsql(PostgreSQL 驱动)。其中 imagick 是硬依赖;zip、intl 不在 require 清单中,未装不影响运行(实测);
  3. 数据库连通:PostgreSQL 以本机 TCP 127.0.0.1:5432 提供服务,pg_hba.conf 对应用账号走 scram-sha-256(实测关键行:host all all 127.0.0.1/32 scram-sha-256);
  4. 磁盘与目录:应用目录 /opt/limbas/,运行时数据在包内 dependent/(BACKUP/UPLOAD/TEMP/USER),需属主 www-data;
  5. 外网可达 GitHub Releases(方案 A);方案 B 的 git clone 需能走代理(见 5.3 实测说明)。

三、版本选型说明

版本线代表版本状态(2026-11-03 实查 GitHub Releases atom)说明
7.1.x7.1.15(2026-08-12 发布,当前最新)推荐7.1.14(2026-06-12)→ 7.1.15 约两月一修,小版本高频补丁
7.0.x7.0.25维护上一大版本线
6.1.x6.1.13旧线跨大版本升级走结构补丁(lmb_dbpatch 机制)

本文安装 7.1.15。发行包两种获取形态:官方 Release 资产 openlimbas-7.1.15.tar.gz(含 vendor/ 依赖,开箱即用,方案 A)与 git 源码树(src/ 下无 vendor、无 composer.lock,需 composer 装配,方案 B)。注意 git tag 带 v 前缀(refs/tags/v7.1.15,git ls-remote --tags 实测),Release 资产 URL 同样带 v。

四、方案 A:在线安装(PPA + 官方 Release tar 包,主线)

4.1 方案说明

系统组件全部走 apt(Apache/PostgreSQL 用发行版默认源,PHP 8.3 用 ondrej PPA),应用本体下载官方 Release tar 包解压即用。这是官方 README「Requirements: Linux server / Apache / PHP8+ / PDO·unixODBC」对应的标准部署形态,也是本次实测采用的主线。

4.2 添加 PHP 8.3 软件源

Ubuntu 22.04 默认 PHP 为 8.1,先加入 PPA:

apt-get update -q && apt-get install -y -q software-properties-common
add-apt-repository -y ppa:ondrej/php
apt-get update -q

验证源文件与候选版本(实测回显):

cat /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list
apt-cache policy libapache2-mod-php8.3 | head -3
deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main
# deb-src https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main
libapache2-mod-php8.3:
  Installed: 8.3.36-1+ubuntu22.04.1+deb.sury.org+1
  Candidate: 8.3.36-1+ubuntu22.04.1+deb.sury.org+1

⚠️ 说明:若环境无法访问 launchpad,可改用 sury.org 官方 deb 源(deb https://packages.sury.org/php/ jammy main)安装同名 php8.3 系列包,本实测环境使用 PPA 渠道。

4.3 安装 Apache、PHP 与扩展、PostgreSQL

apt-get install -y -q apache2 postgresql \
  libapache2-mod-php8.3 php8.3-cli php8.3-pgsql php8.3-gd php8.3-imagick \
  php8.3-imap php8.3-curl php8.3-odbc php8.3-soap php8.3-xml php8.3-mbstring

安装后逐一验证组件版本(实测回显):

apache2 -v && php -v | head -1 && psql --version
Server version: Apache/2.4.52 (Ubuntu)
Server built:   2026-10-08T19:59:46
PHP 8.3.36 (cli) (built: Oct 21 2026 14:31:50) (NTS)
psql (PostgreSQL) 14.24 (Ubuntu 14.24-0ubuntu0.22.04.1)

已装入的 PHP 包清单核对(dpkg -l | grep -E "^ii (php|libapache2)" 实测节选,全部 8.3.36 sury 版):

libapache2-mod-php8.3 8.3.36-1+ubuntu22.04.1+deb.sury.org+1
php8.3-cli            8.3.36-1+ubuntu22.04.1+deb.sury.org+1
php8.3-gd             8.3.36-1+ubuntu22.04.1+deb.sury.org+1
php8.3-imagick        3.8.1-1+ubuntu22.04.1+deb.sury.org+1
php8.3-odbc           8.3.36-1+ubuntu22.04.1+deb.sury.org+1
php8.3-pgsql          8.3.36-1+ubuntu22.04.1+deb.sury.org+1

4.4 创建数据库与应用账号

以 postgres 超级用户建角色与库(⚠️ 实测注意:应用角色 limbas 不带 CREATEDB 权限,后续如需建恢复演练库必须由超管执行,见第九章 FAQ):

su - postgres -c "createuser limbas -P"   # 按提示输入口令 q1w2e3r4
su - postgres -c "createdb -O limbas limbasdb"

验证角色与库(实测回显):

su - postgres -c "psql -c \"\\du limbas\""
PGPASSWORD=q1w2e3r4 psql -h 127.0.0.1 -U limbas -l | head -6
           List of roles
 Role name | Attributes | Member of
-----------+------------+-----------
 limbas    |            | {}

                                List of databases
      Name      |  Owner   | Encoding | Collate |  Ctype  |   Access privileges
----------------+----------+----------+---------+---------+-----------------------
 limbasdb       | limbas   | UTF8     | C       | C       |
 postgres       | postgres | UTF8     | C.UTF-8 | C.UTF-8 |

💡 技术拓展:PostgreSQL 口令加密方式不止一种——

方式特点适用
scram-sha-256挑战-应答,口令不上线,PG 10+ 默认生产推荐(本文实测采用)
md5旧式哈希应答仅兼容老客户端
trust不校验只可用于本机调试
peer按操作系统用户名映射postgres 超级用户本机管理

本文环境 pg_hba.conf 对 limbas 走 scram-sha-256、对 postgres 保留 peer,即混合使用超管本机管理与应用 TCP 口令认证。

4.5 下载并校验官方安装包

mkdir -p /opt/limbas && cd /opt/limbas
curl -L -o openlimbas-7.1.15.tar.gz \
  "https://github.com/limbas/limbas/releases/download/v7.1.15/openlimbas-7.1.15.tar.gz" \
  --write-out "HTTP %{http_code} %{size_download}\n" -s
sha256sum openlimbas-7.1.15.tar.gz

实测回显(直连 GitHub 成功,无需代理):

HTTP 200 11667224
052f503973129ddb673209344d650132da2d357eac08a374fdf6ee5fb0e7ead5  openlimbas-7.1.15.tar.gz

⚠️ 注意:该 Release 资产是扁平打包(tar -tzf 首项为 ./LICENSE,无顶层目录),解压必须用 -C 指定目标目录,否则会散落在当前目录。

4.6 解压与目录权限

mkdir -p /opt/limbas/openlimbas-7.1.15
tar -xzf /opt/limbas/openlimbas-7.1.15.tar.gz -C /opt/limbas/openlimbas-7.1.15
chown -R www-data:www-data /opt/limbas/openlimbas-7.1.15
ls /opt/limbas/openlimbas-7.1.15/

实测回显:

LICENSE  Limbarine.png  README.md  composer.json  dependent  limbas_src  package.json  public  vendor

vendor/ 已随包内置(Composer 依赖免装配);dependent/ 下 BACKUP/ UPLOAD/ TEMP/ USER/ EXTENSIONS/ inc/ 为运行时可写数据区,inc/include_db.lib 是数据库连接配置文件(见 4.8 与配置篇)。

4.7 配置 Apache 虚拟主机

创建 /etc/apache2/sites-available/limbas.conf(实测全文):

<VirtualHost *:80>
    ServerName limbas-server
    DocumentRoot /opt/limbas/openlimbas-7.1.15/public
    <Directory /opt/limbas/openlimbas-7.1.15>
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/limbas_error.log
    CustomLog ${APACHE_LOG_DIR}/limbas_access.log combined
</VirtualHost>

逐项说明:DocumentRoot 只暴露 public/ 入口目录,应用源码 limbas_src/ 不在 Web 根下;AllowOverride All 是必须项——包内 public/.htaccess 依赖它生效(mod_rewrite 把非静态请求统一重写进 index.php,并透传 Authorization 头供 REST 认证);两个日志变量指向独立日志文件,便于排障。

启用模块与站点并校验语法(实测回显):

a2enmod rewrite
a2enmod deflate
a2dissite 000-default.conf
a2ensite limbas.conf
apachectl configtest
systemctl reload apache2
Module rewrite already enabled
Considering dependency filter for deflate:
Module filter already enabled
Module deflate already enabled
Site 000-default already disabled
Site limbas already enabled
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.89.59.2. Set the 'ServerName' directive globally to suppress this message
Syntax OK

(AH00558 为全局 ServerName 未设的告警,不影响站点运行;如需消除可在 apache2.conf 加 ServerName limbas-server。)

4.8 数据库连接配置与应用初始化

写入连接文件 /opt/limbas/openlimbas-7.1.15/dependent/inc/include_db.lib(实测全文,安装器自动生成,手工部署时可直接落盘):

$DBA['DB']='postgres'; $DBA['DBCUSER']='limbas'; $DBA['DBCPASS']='q1w2e3r4'; $DBA['DBCNAME']='limbasdb';
$DBA['DBUSER']='limbas'; $DBA['DBPASS']='q1w2e3r4'; $DBA['DBNAME']='limbasdb'; $DBA['DBSCHEMA']='public';
$DBA['DBHOST']='localhost'; $DBA['LMHOST']='localhost'; $DBA['PORT']='5432'; $DBA['CHARSET']='UTF-8';
$DBA['ODBCDRIVER']='PDO';
define('LMB_ENC_KEY','bc22c1447d60013887b7da62e48297e2773c27a283924bf48701c9d1d1f39b58');

ODBCDRIVER='PDO' 表示走 PDO 而非 unixODBC;LMB_ENC_KEY 为安装生成的 64 位十六进制加密密钥,生产环境须保密(本文值为演示环境实测值)。随后访问 http://limbas-server/ 进入 Web 安装向导(limbas_src/admin/install/ 提供 autoinstall 与 Installer 类),按提示完成建表与初始数据;本环境同时导入了官方演示数据包(dependent/BACKUP/demo.tar.gz,518754 字节,随包发布),得到 adressen/kunden/aufgaben 等 demo 表。

设置管理员口令(Limbas 存 bcrypt,实测命令与回显):

H=$(php -r "echo password_hash('q1w2e3r4', PASSWORD_DEFAULT);")
PGPASSWORD=q1w2e3r4 psql -h 127.0.0.1 -U limbas -d limbasdb -c \
  "UPDATE lmb_userdb SET username='admin', passwort='$H' WHERE user_id=1;"
UPDATE 1

💡 技术拓展:PHP 口令散列可选算法对比——

算法标识特点
bcrypt(PASSWORD_DEFAULT)$2y$自适应代价因子,PHP 默认,Limbas 实测使用(cost=10)
Argon2id$argon2id$抗 GPU 更强,需 PHP 编译支持
md5/sha1无前缀已不安全,禁用

本文按 Limbas 出厂逻辑使用 password_hash() 默认 bcrypt,与库内既有口令格式($2y$10$…)一致。

4.9 systemd 托管

systemctl enable apache2
systemctl enable postgresql

实测回显(enable 输出 SysV 同步信息属正常):

Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2
Synchronizing state of postgresql.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable postgresql

验证开机自启与运行态(实测回显):

systemctl is-enabled apache2; systemctl is-active apache2
systemctl is-enabled postgresql; systemctl is-active postgresql
enabled
active
enabled
active

4.10 安装验证

登录页与主框架验证(实测回显):

curl -s -c /tmp/cookies.txt http://localhost/ | grep -o "<title>[^<]*</title>"
curl -s -b /tmp/cookies.txt -c /tmp/cookies.txt \
  -d 'username=admin&password=q1w2e3r4' http://localhost/index.php | grep -o "<title>[^<]*</title>"
<title>Limbas-Demo - Login</title>
<title>Limbas Enterprise Unifying Framework V 7.1.15</title>

数据库侧确认结构版本与访问日志:

PGPASSWORD=q1w2e3r4 psql -h 127.0.0.1 -U limbas -d limbasdb -c \
  "SELECT id,major,version,revision FROM lmb_dbpatch ORDER BY id DESC LIMIT 1;"
tail -2 /var/log/apache2/limbas_access.log
 id  | major | version | revision
-----+-------+---------+----------
 726 |     7 |       1 |       15
(1 row)

127.0.0.1 - - [02/Nov/2026:23:05:50 +0000] "GET / HTTP/1.1" 200 2240
10.89.59.1 - - [02/Nov/2026:23:09:28 +0000] "POST /index.php HTTP/1.1" 200 111951

页面 title 显示 V 7.1.15、补丁表最新行 7.1.15、登录 POST 返回 200(111951 字节主框架页),三项互相印证,安装完成。

五、方案 B:git 源码 + composer 依赖装配(备用)

5.1 方案说明

从 GitHub 仓库按 tag 克隆源码树,用 Composer 现场装配 vendor/ 依赖。适合需要审计源码、打补丁或跟踪主干的场景。注意仓库布局与 Release 包不同:源码树的根目录没有应用,应用在 src/ 下(src/{composer.json, limbas_src, public, dependent}),且无 composer.lock,composer install 会现场解析依赖(实测 65 个包、vendor 147M)。

5.2 安装 git、unzip 与 composer

apt-get install -y -q git unzip php8.3-zip
git --version
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
composer --version

实测回显:

git version 2.34.1
Composer (version 2.11.1) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer
Composer version 2.11.1 2026-10-30 14:52:10
PHP version 8.3.36 (/usr/bin/php8.3)

5.3 克隆源码(tag 带 v 前缀)

git clone --depth 1 --branch v7.1.15 https://github.com/limbas/limbas.git /opt/limbas/limbas-src

⚠️ 网络实测说明:本环境直连 git clone 报 fatal: unable to access … GnuTLS recv error (-110): The TLS connection was non-properly terminated,改经代理(export https_proxy=http://192.168.1.72:7897)后克隆成功;而方案 A 的 Release 资产 curl 直连即可(4.5 实测 200)。另外 tag 名必须带 v 前缀——误用 --branch 7.1.15 实测报 Remote branch 7.1.15 not found in upstream origin。

克隆后核对布局(实测回显):

ls /opt/limbas/limbas-src/src/
composer.json  dependent  limbas_src  package.json  public

5.4 composer 装配依赖

cd /opt/limbas/limbas-src/src
composer install --no-interaction --no-progress

实测输出节选(实测首尾):

Class LimbasLogRoute located in ./limbas_src/extra/lmbObject/log/LimbasLogRoute.php does not comply with psr-4 autoloading standard (rule: Limbas\ => ./limbas_src). Skipping.
...
48 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

⚠️ 说明:中间大段 does not comply with psr-4 … Skipping 是 vlegacy/ 遗留类(pChart、Horde_Text_Diff 等)不符合自动加载规范被跳过,属 7.x 遗留代码噪音,不影响装配结果与运行。

验证装配结果(实测回显):

composer show | wc -l; du -sh vendor
65
147M    vendor

5.5 接入主线后续步骤

方案 B 完成后,从 4.7 起照做,仅需把 vhost 的 DocumentRoot 与 <Directory> 路径中的 openlimbas-7.1.15 替换为 limbas-src/src,初始化与验证(4.8~4.10)完全一致。

六、方案对比与选择建议

维度方案 A:Release tar 包方案 B:git + composer
版本v7.1.15 发布资产(sha256 固定)tag v7.1.15 源码树
是否需联网下载需 GitHub(实测直连可达)clone 需 GitHub(实测需代理)+ packagist
依赖 vendor包内内置,开箱即用现场解析 65 包,vendor 147M
目录布局根即应用根应用在 src/ 子目录
版本一致性与官方发布产物逐字节一致依赖解析结果随时间漂移(无 lock 文件)
适用生产部署(推荐主线)源码审计/打补丁/二次开发

建议:生产环境一律用方案 A(可校验、可复现);仅在需要改源码时用方案 B,且装配后立即 composer update --lock 固化 lock 文件以便复现。

七、配置说明

装机后需要关注的最小配置面(完整参数体系见《Limbas 7.1.15 配置参数详解》):

  1. 数据库连接:dependent/inc/include_db.lib(见 4.8),改库/改密后无需重启 Apache,即时生效;
  2. PHP 运行参数:/etc/php/8.3/apache2/php.ini 实测出厂 upload_max_filesize=2M、post_max_size=8M、memory_limit=128M、max_execution_time=30,文件上传类业务建议调大前两项后 systemctl reload apache2;
  3. 应用全局配置(UMGVAR 143 项):登录后 index.php?action=setup_umgvar 集中管理,安装路径变量(id=3)出厂默认指向 /srv/www/htdocs/projects/openlimbas/dependent/,装机后应改为本机真实路径;
  4. 独立日志:vhost 已配 limbas_access.log / limbas_error.log,见《Limbas 7.1.15 常用运维命令与排障实操》。

八、常见问题(FAQ)

Q1: apt-cache policy php8.3 查不到候选版本? A: 未正确添加 PPA。实测有效源行为 deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main,添加后必须再 apt-get update;离线环境改用 sury.org deb 源(见 4.2 ⚠️)。

Q2: 打开首页白屏或报 PHP 版本错误? A: 确认 Apache 加载的是 php8.3 模块:apache2ctl -M | grep php 应出现 php_module,且 php -v 为 8.3.36。Ubuntu 默认源装的 8.1 与 PPA 的 8.3 共存时,需 a2dismod php8.1 && a2enmod php8.3 后重启 Apache。

Q3: 登录页能出,但登录报数据库错误? A: 按实测排障链检查:① include_db.lib 的账号/口令/库名与 psql -l 一致;② pg_hba.conf 对 host 127.0.0.1 是 scram-sha-256(不是 peer——peer 仅限本机 socket 超级用户,误配应用账号会报 Peer authentication failed);③ 用应用账号连一次:PGPASSWORD=q1w2e3r4 psql -h 127.0.0.1 -U limbas -d limbasdb -c "SELECT 1;" → 回显 1 row。

Q4: git clone 报 GnuTLS recv error (-110)? A: 实测为直连 GitHub 的 TLS 链路被中断,走代理后成功(见 5.3 ⚠️ 网络说明);或改用方案 A 的 curl 下载 Release 资产(实测直连 200)。

Q5: composer install 报 Could not find a composer.json file? A: 在仓库根目录执行了。源码树的应用根在 src/(实测 ls 回显见 5.3),必须 cd /opt/limbas/limbas-src/src 后再执行。

九、卸载与清理

以下命令按逆序清理本指南部署(⚠️ 破坏性操作,执行前确认库数据已备份;其中删除方案 B 测试树与 limbas_restore 演练库两步为本环境实测执行,回显见后):

a2dissite limbas.conf
systemctl stop apache2
rm -rf /opt/limbas/limbas-src          # 方案 B 源码树(实测执行)
PGPASSWORD=q1w2e3r4 dropdb -h 127.0.0.1 -U limbas limbas_restore   # 恢复演练库(实测执行)
su - postgres -c "dropdb limbasdb"     # 业务库(须 postgres 超管,见 FAQ/权限说明)
su - postgres -c "dropuser limbas"
rm -rf /opt/limbas/openlimbas-7.1.15 /opt/limbas/openlimbas-7.1.15.tar.gz
apt-get purge -y -q apache2 postgresql php8.3 libapache2-mod-php8.3
systemctl start apache2

实测回显(删除方案 B 树与演练库后):

rm -rf /opt/limbas/limbas-src && ls /opt/limbas/
PGPASSWORD=q1w2e3r4 dropdb -h 127.0.0.1 -U limbas limbas_restore
PGPASSWORD=q1w2e3r4 psql -h 127.0.0.1 -U limbas -l
openlimbas-7.1.15
openlimbas-7.1.15.tar.gz
                              List of databases
   Name    |  Owner   | Encoding | Collate |  Ctype  |   Access privileges
-----------+----------+----------+---------+---------+-----------------------
 limbasdb  | limbas   | UTF8     | C       | C       |
 postgres  | postgres | UTF8     | C.UTF-8 | C.UTF-8 |
 template0 | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
           |          |          |         |         | postgres=CTc/postgres
 template1 | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
           |          |          |         |         | postgres=CTc/postgres
(4 rows)

十、参考链接

Ubuntu 22.04 安装 Limbas 7.1.15 指南 - Quzuo