Collec-Multi-instances : scripts to create or manage multiple instances of collec-science in the same server
Collec-Science includes a mechanism that allows a single version of the code to be shared between several different instances (different databases and URLs). Each instance has its own configuration space, which includes:
- the .env file, which contains the application settings
- the encryption keys (id_collec and id_collec.pub)
- a temporary storage folder (TEMP), which also contains user session files generated by PHP in the sessions subfolder (from version v26.1.0 onwards)
Each instance must have its own URL. The mechanism used to separate each instance is described here: https://equinton.github.io/ppcidocs/fr/multi-instance.html
To facilitate the management of these instances, this repository has been created and offers a number of tools that allow you to:
- create instances automatically
- update all databases when required by application updates.
The files have been adapted from those used by the INRAE hosting platform. You will find the corresponding suffixes in the scripts and examples.
In the /var/local folder on your server:
mkdir collec-science
cd collec-science
git clone https://github.com/collec-science/multi-instances.gitEvery day, databases must be processed to extract the list of samples that are about to expire or events that are scheduled.
To schedule the script:
line="0 7 * * * /var/local/collec-science/multi-instances/generateCollectionsMailsAllInstances.sh"
echo $line | crontab -u www-data -To update all instances when a release is published:
- Ensure that you have a full databases backup!
- get the last version of the app:
cd /var/www/collec2App/collec-science
git pull origin main- update the databases:
/var/local/collec-science/multi-instances/updateAllDb.shBefore performing any operation, ensure that you have backups of your databases and server configuration. To back up your databases, I highly recommend using pgbackrest.
To function correctly, instances must have the same URL suffix (e.g., collec-science.inrae.fr) and have a generic certificate (*.collec-science.inrae.fr).
If you use Shibboleth authentication, you will need to install the Mellon module for Apache2 and follow the instructions described here: https://www.collec-science.org/installer-le-logiciel2/installation-et-mise-a-jour/identification-par-federation
Translated with DeepL.com (free version)