diff --git a/docs/reports/2024-09-02-off-server-double-apache.md b/docs/reports/2025-01-10-off-server-double-apache.md similarity index 85% rename from docs/reports/2024-09-02-off-server-double-apache.md rename to docs/reports/2025-01-10-off-server-double-apache.md index 34ff89e0..5e28d0d1 100644 --- a/docs/reports/2024-09-02-off-server-double-apache.md +++ b/docs/reports/2025-01-10-off-server-double-apache.md @@ -1,4 +1,6 @@ -# 2024-09-02 OFF server double apache +# 2025-01-10 OFF server double apache + +(initially started on 2024-09-02) ## Goal @@ -43,25 +45,28 @@ See https://github.com/openfoodfacts/openfoodfacts-server/pull/10766 ## Installation / Migration 1. checkout the new release / code +1. symlink new envvars: `ln -s /srv/opf/conf/apache-2.4/off-envvars /etc/apache2/` 1. change ports .conf link: `unlink /etc/apache2/ports.conf; ln -s /srv/opf/conf/apache-2.4/ports.conf /etc/apache2/` 2. symlink `ln -s /srv/$SERVICE/conf/systemd/apache2@.service.d /etc/systemd/system/` +2. ensure mpm prefork symlink is the right one: + `unlink /etc/apache2/mods-available/mpm_prefork.conf; ln -s /srv/$SERVICE/conf/apache-2.4/mpm_prefork.conf /etc/apache2/mods-available/` +2. (off only) symlink `ln -s /etc/apache2 /etc/apache2-priority; ln -s /var/log/apache2 /var/log/apache2-priority` +2. check nginx configuration is ok (`nginx -t`) 1. `systemctl daemon-reload` -2. symlink `ln -s /etc/apache2 /etc/apache2-priority; ln -s /etc/apache2 /etc/apache2-standard` -2. symlink `ln -s /var/log/apache2 /var/log/apache2-priority; ln -s /var/log/apache2 /var/log/apache2-standard` -2. enable the apache2@standard.service apache2@priority.service -2. start apache2@priority.service -2. and test it's working using `curl http://127.0.0.1:8002/display.pl -H "Host: world.openfoodfacts.org"` - `curl http://127.0.0.1:8002/display.pl?api/v2/product/3017620422003/ -H "Host: world.openfoodfacts.org"` -2. check nginx configuration is ok (`nginx -t`) and restart the service +2. (off only) enable apache2@priority.service +2. (off only) start apache2@priority.service +1. verify deployment `. env/env.$SERVICE; /srv/$SERVICE/scripts/deploy/verify-deployment.sh` +3. check priority apache2 is working: + `curl http://127.0.0.1:8002/cgi/display.pl?/ -H "Host: world.openfoodfacts.org"` + `curl http://127.0.0.1:8002/cgi/display.pl?api/v2/product/3017620422003/ -H "Host: world.openfoodfacts.org"` +2. stop and start apache2.service +2. restart nginx service 3. check both apache2 are working: * `curl http://127.0.0.1/ -H "Host: world.openfoodfacts.org"` * `curl http://127.0.0.1/discover -H "Host: world.openfoodfacts.org"` -2. stop apache2.service -2. start apach2@standard.service -3. test it's working using curl commands above and using your browser -1. deactivate apache2.service -1. unlink the /etc/systemd/system/apache2.service -1. unlink /srv/$SERVER_NAME/log.conf +3. test it's working using your browser +2. (off only) enable and start monitoring of the apache2@priority.service: + `systemctl enable --now prometheus-apache-exporter@priority.service` Celebrate ! @@ -198,3 +203,4 @@ as they log in different files. **FIXME:** modify doc explaining off installation +**FIXME:** modify apache exporter config \ No newline at end of file