This document describes how to deploy a new version of Globus-ILIAS-Rest to
the production installation (https://www.lernen-mit-globus-baumarkt.de).
Production host in this setup is
hati(the ILIAS host ofwww.lernen-mit-globus-baumarkt.de).
Test/dev deployments use the same steps with a differentNODE_ENV
(test→globusfm-dev2,dev/dev2→ local).
Production consists of three parts that may change independently:
| Part | Location | Updated with |
|---|---|---|
| Node.js REST service | the project dir on the server, run via pm2 |
code + npm install + restart |
| Frontend (Vue SPA) | vue/dist (built, not in git) |
npm run build |
| PHP component | $ILIASBASEDIR/globus-ilias-rest |
copyPhpHati |
A full update therefore touches all three; a code-only change may only need the
first two.
node -v).pm2 installed and the service already registered as globus-ilias-rest.NODE_ENV=prod is set for the service (e.g. in ~/.bashrc or in the pm2settings.prod.json exists and is correct (DB credentials, ports, tokens)./popcorn SPA.git rev-parse HEAD) or tagsettings.prod.json if it was modified on the serversettings.prod.json and php/globus-ilias-rest/tokenRun the following on the production host, inside the project directory.
Always update via git:
git fetch --all
git checkout <tag-or-branch> # e.g. v0.4.0 or master
git pull
Always deploy via git. Only files tracked in git are deployed; untracked or
locally modified files must not reach production. Make sure the working copy
is clean (git status) and on the intended revision before proceeding.
npm install
(Use npm ci if you want a clean, lockfile-exact install.)
The production build must use the production env values
(vue/.env.production). vite.config.js selects that file whenVITE_ENV=production is set:
VITE_ENV=production npm run build
This writes the SPA to vue/dist/, which app.js serves under /popcorn/ui.
Do not rely on
cp vue/.env.$NODE_ENV vue/.envfor production: withNODE_ENV=prodthere is novue/.env.prodfile. UseVITE_ENV=production.
php/ changed)./copyPhpHati
copyPhpHati copies php/globus-ilias-rest/* and its .htaccess into$ILIASBASEDIR/globus-ilias-rest (/var/local/ilias/globusfach/ilias/... onhati).
Check the target path first. Open
copyPhpHatiand verify thatP
(/var/local/ilias/globusfach/ilias/globus-ilias-rest) still matches the
actual ILIAS base dir on the server. The path can change between ILIAS
installations/upgrades — if it does, fix it in the script before running it.The
tokenfile protects the PHP endpoint and is covered by.htaccess
(Require all denied). After copying, make sure the file is still present
and the owner/permissions are correct (chown -R www-data:www-data).Note: the repo currently has no
copyPhpscript, althoughpackage.json
defines"php": "bash copyPhp". OnhatiusecopyPhpHatidirectly. The
final line ofcopyPhpHati
(sudo cp $P/api.php $P/login.php) refers to the oldapi.phpname and will
fail / is a no-op now that the file is calledlogin.php; the precedingcpalready installslogin.php.
pm2 restart globus-ilias-rest
pm2 save
Check that it is online:
pm2 ls
NODE_ENV=prod npm run test-connect
All tests must succeed. (The tests for "the rest service" require the service to
be running — see step 5.)
Quick manual checks against production:
# service version
curl https://www.lernen-mit-globus-baumarkt.de/popcorn/api/version
# authenticated API
curl "https://www.lernen-mit-globus-baumarkt.de/popcorn/api/user?token=$TOKEN"
# PHP component
curl "https://www.lernen-mit-globus-baumarkt.de/globus-ilias-rest/login.php?token=$ILIASTOKEN&command=ping"
# frontend (SPA)
curl -I https://www.lernen-mit-globus-baumarkt.de/popcorn/ui/
Then load the SPA in the browser and verify the user search / course pages work.
If something is wrong:
git checkout <previous-tag-or-commit>npm installVITE_ENV=production npm run build./copyPhpHati (if the PHP component changed)pm2 restart globus-ilias-restNODE_ENV=prod npm run test-connectNODE_ENV must be prod for the service, otherwise the wrongsettings.*.json is loaded.authtokensettings.prod.json) and the PHP iliastoken (also stored inphp/globus-ilias-rest/token). If one changes, update both.vue/dist and node_modules are ignored) — itnpm run php is currently broken (no copyPhp script); usecopyPhpHati for production.$INSTALLDIR/log.log — should be included in a logrotationsettings.prod.json → log.level (defaultinfo); the LOG_LEVEL env var overrides it (debug, info, warn,error, silent/off).pm2 logs:
pm2 logs globus-ilias-rest
pm2 flush # clear pm2 logs
pm2 logging can be turned off with --disable-logs (not advised).