Skip to content

Instructions for production install to Ubuntu24.04#600

Merged
ruslanbaidan merged 2 commits into
monarc-project:masterfrom
tr-electronic-edv:ubuntu24
Mar 6, 2026
Merged

Instructions for production install to Ubuntu24.04#600
ruslanbaidan merged 2 commits into
monarc-project:masterfrom
tr-electronic-edv:ubuntu24

Conversation

@tr-electronic-edv
Copy link
Copy Markdown
Contributor

@tr-electronic-edv tr-electronic-edv commented Feb 26, 2026

Instruction for Ubuntu 24 is based on the previous instructions for Ubuntu 22.

Added or changed:

  • php8.3 is used (the default in Ubuntu24.04 repos)

  • "get-and-unpack-the-latest-release" script is extracted into the separate file and refactored:

    • logic refactor (simplify PATH construction and directories creation)
    • check the github response is correct, e.g. not null or rate-limit error
    • improve soft links creation. Previous ln -s would fail if the symlink already exists, e.g. during the version upgrade.
    • fail on errors with a message, useful for debug and CI/CD pipelines, e.g. SSL error behind a corporate firewall
  • set the php limits and log settings in the apache config, that

    • does not spoil the global php.ini when the server runs multiple websites.
    • simpler for the user
    • avoids multi-line "sed" modifications of the php.ini in Docker or CI/CD scripts
  • Rearrange the manual structure. Now it is less nested and more focused:

    • Dependencies
    • Files
    • Webserver
    • Database

Tests

Install instruction was tested on:

  • a clean Ubuntu 24.04 machine
  • a clean Ubuntu 24.04 in wsl2

The Front Office:

  • no autotests found
  • tested manually the website, no errors found
  • not all existing pages and transitions has been tested. Some php8.3 incompatibility errors could still exists.

Has not been tested

The Statistics installation and website

Related Issues: #599

Questions

  • Does it require a DB change? - NO
  • Are you using it in production? - I'm going to

Release Type: Minor

@tr-electronic-edv tr-electronic-edv marked this pull request as ready for review February 27, 2026 08:30
@tr-electronic-edv
Copy link
Copy Markdown
Contributor Author

@ruslanbaidan I've also removed zip unzip git gettext from apt-get install because I did not found where these are used in production, but may be in the Monarc export or import ?

@ruslanbaidan
Copy link
Copy Markdown
Contributor

Thank you for your contribution!

Replying your question:

@ruslanbaidan I've also removed zip unzip git gettext from apt-get install because I did not found where these are used in production, but may be in the Monarc export or import ?

I would keep git and gettext extensions in the installation instructions as they are used in some scripts that are used for the versions update:
https://github.com/monarc-project/MonarcAppFO/blob/master/scripts/update-all.sh#L35
https://github.com/monarc-project/MonarcAppFO/blob/master/scripts/compile_translations.sh#L10
There are custom packages on the angular side and laminas to implement the i18n translations logic, so gettext is not needed there.
Regarding zip, unzip, normaly not required directly by the tool, but ansible may fail on the unarchive of release artefact:
https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/unarchive_module.html
https://github.com/monarc-project/ansible-ubuntu/blob/c51384eecf601dff74c4fe831dc4e25bcba23bbc/playbook/monarcfo/tasks/main.yaml#L34

The versions Monarc infrastructure installation and updates are executed by ansible:
https://github.com/monarc-project/ansible-ubuntu

That is where the docker setup, containers build and (re-)run is going to be implemented.
We have plans to move it quite soon.

@tr-electronic-edv
Copy link
Copy Markdown
Contributor Author

tr-electronic-edv commented Mar 2, 2026

  • instruction updated (added zip unzip git gettext)
  • install_latest_fo_release.sh script has been moved into the ./scripts/ where other scripts are.
  • UPDATE.ubuntu.md has been fixed (add line that copies the local.php configuration file from old to new release)

The PR is ready to be tested and merged.

p.s.

At the moment the install_latest_fo_release.sh script only gets and unpacks the files on the disk. The Apache and Database setups are done manually by the user.

Then I saw your UPDATE.ubuntu.md, which does get a new release + run migrations + clear cache.

Several steps from the Install and Upgrade processes are similar or duplicated:

Install Upgrade
get release files get release files
set up Apache
create local.php copy local.php from last release
create DB / db_user
Bootstrap DB
Run Migrations Run Migrations
create Admin user
clear cache

Idea 1

Many of these steps could be automated. I had a temptation to unite these steps in one script, but gave up to keep this PR simple.

The Apache and DB configurations, which are different for every client, could be semi-automated via a series of questions to user (may be show some default options, too).

And for CI/CD/Dockerfile you could use "--auto" with some defaults like "localhost" and passwords from the environment.

Then you will have one "install or upgrade" script to put on the website and simplify the Ubuntu installation instruction to curl https://monarc.lu/install.sh | sudo bash

Idea 2

From another side, you could put the instructions from UPDATE.ubuntu.md + auto-backup into a separate scripts/upgrade_fo_release.sh.

Then the "install_latest_fo_release.sh" and "upgrade_fo_release.sh" will be a good companions (the names could be better.)

@ruslanbaidan
Copy link
Copy Markdown
Contributor

Thank you for the contribution, what I tested, it works well!
Just a small note above using $BASEDIR.
Diakuyu!

@tr-electronic-edv
Copy link
Copy Markdown
Contributor Author

З задоволенням. Щодо $BASEDIR - не бачу нiяких комментарiв, але перейменувати змiнну це ж невелика справа.

Comment thread scripts/install_latest_fo_release.sh
@ruslanbaidan ruslanbaidan merged commit fcdbe63 into monarc-project:master Mar 6, 2026
2 checks passed
@tr-electronic-edv
Copy link
Copy Markdown
Contributor Author

Зараз побачив, дякую! Вдалого дня!

@tr-electronic-edv tr-electronic-edv deleted the ubuntu24 branch March 6, 2026 10:15
@ruslanbaidan
Copy link
Copy Markdown
Contributor

З задоволенням. Щодо $BASEDIR - не бачу нiяких комментарiв, але перейменувати змiнну це ж невелика справа.

I forgot to post it, but it's merged now and corrected in the mater.
I also added you to the contributing list: https://github.com/monarc-project/MonarcAppFO/blob/master/CONTRIBUTING.md
Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants