fix(cac-lsphp): mount docroot at /home/$user + symlink for true 1:1 compatibility

Customer concern: sites with /home/<user>/public_html baked into config or the
DB must keep working — a changed in-container docroot path would break WordPress
ABSPATH, hardcoded includes, cached absolute paths, etc., making the upgrade a
non-drop-in.

Fix: the sidecar now mounts the docroot at /home/$user (IDENTICAL to
cac-fpm/cac-litespeed) and the entrypoint symlinks /mnt/users/<user>/<domain> ->
/home/$user. OLS still serves from its bulk /mnt/users mount and sends lsphp
that path (no remap available), but the symlink resolves it to the real
/home/$user files AND PHP canonicalises it — so __FILE__/__DIR__/realpath/ABSPATH
all report /home/<user>/public_html.

Verified end-to-end through the shared OLS: a request reports
__FILE__=/home/homeuser/public_html/probe.php, ABSPATH=/home/homeuser/public_html/,
and stored /home paths resolve. True 1:1 drop-in.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-10 06:54:28 -07:00
parent e99b8cb2d1
commit fc65b68bd6
2 changed files with 41 additions and 44 deletions

View File

@@ -4,10 +4,10 @@
## (matches the shared-vhost-template.tpl convention). One directive per line —
## OLS PlainConf does NOT accept ';' separators.
##
## CRITICAL (feedback_ols_lsapi_no_script_filename_remap): docRoot here MUST be
## the SAME absolute path the cac-lsphp sidecar has mounted, because OLS hands
## lsphp exactly docRoot+URI as SCRIPT_FILENAME and lsphp opens it. Both are
## /mnt/users/<user>/<domain>/public_html. The panel asserts this parity.
## docRoot is /mnt/users/<user>/<domain>/public_html — the shared-ols container's
## view (bulk /docker/users->/mnt/users mount). OLS sends lsphp exactly this path
## (no remap); the cac-lsphp sidecar symlinks /mnt/users/<user>/<domain> -> its
## real /home/<user> mount, so PHP canonicalises it to /home/<user>/public_html.
docRoot ~~DOCROOT~~
enableScript 1