Installation d'une machine virtuelle (Linux)
  • 14 Jul 2022
  • 2 Minutes à lire
  • Contributeurs
  • Sombre
    Clair
  • PDF

Installation d'une machine virtuelle (Linux)

  • Sombre
    Clair
  • PDF

Article Summary

1. Prérequis technologiques

  • Linux Red Hat 7.3 (testé le 2018-05-14)
  • Java 8 - Package 171 et + (testé le 2018-05-14)

2. Installation des packages resquis

2.1 Installation d'Open Java version 8

1
yum install java-1.8.0-openjdk-devel

2.2 Installation du package Unzip

1
yum install unzip

2.3 Installation de Gradle

1
2
3
4
cd /opt
wget https://services.gradle.org/distributions/gradle-3.5.1-bin.zip
unzip gradle-3.5.1-bin.zip
mv gradle-3.5.1 gradle

2.4 Installer Service Constellio

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Création d'un répertoire Constellio
mkdir /opt/constellio
 
# Créer le répertoire git
/opt/constellio/git et webapp
mkdir /opt/constellio/git
mkdir /opt/constellio/webapp
 
# Dans ce répertoire, cloner constellio
git clone https://github.com/doculibre/constellio.git
cd constellio
 
# Choisir le dernier release (x.x.x, ici 7.7.5) :
git tag -l
git checkout 7.7.5
 
# Créer un fichier de version (indique le numéro de version pour le build)
nano /opt/constellio/git/version
 
# Ajouter le numéro de version du tag (remplacer par le tag sélectionné) :
7.7.5
 
# Configurer le build avec les fichiers gradle
cd /opt/constellio/git
wget https://raw.githubusercontent.com/doculibre/constellio/master/build.gradle.main
mv build.gradle.main build.gradle
wget https://raw.githubusercontent.com/doculibre/constellio/master/settings.gradle.main
mv settings.gradle.main settings.gradle
 
# Construire Constellio
/opt/gradle/bin/gradle war
 
# Lorsque le build est complété, la terminal indiquera :
# ....
# BUILD SUCCESSFUL
# Récupérer le build dans :
/opt/constellio/git/constellio/build/libs
 
# Copier le fichier "war" dans :
/opt/constellio/webapp
cp constellio-7.7.5.war /opt/constellio/webapp
 
# Dézipper
unzip constellio-7.7.5.war
 
# Récupérer le build dans :
/opt/constellio/git/constellio/build/libs
 
# Copier le fichier "war" dans :
/opt/constellio/webapp
cp constellio-7.7.5.war /opt/constellio/webapp
 
# Dézipper
unzip constellio-7.7.5.war
 
# Créer le fichier waitforsolr
nano /opt/constellio/waitforsolr
 
# Avec le contenu suivant :
 
----
#!/bin/bash
until $(curl --output /dev/null --silent --head --fail http://localhost:8983/solr); do
  printf '.'
  sleep 2
done
----
 
# Modifier l'accès au répertoire
chmod u+x /opt/constellio/waitforsolr
 
# Dans le chemin /opt/constellio, créer les répertoires suivants :
mkdir conf
cd conf
 
# Créer le fichier constellio.properties
nano constellio.properties
 
----
# === DATASTORE CONFIGURATION ===
# *** WARNING : collections will be deleted ***
dao.records.type=http
dao.records.http.url=http://localhost:8983/solr/
dao.contents.type=filesystem
dao.settings.type=filesystem
dao.contents.filesystem.folder=/opt/constellio/contents/
secondTransactionLog.enabled=true
secondTransactionLog.folder=/opt/constellio/transaction_log/
----
 
# Créer constellio.setup.properties
nano constellio.setup.properties
 
----
#These configs are used when Constellio is started the first time
admin.servicekey=adminkey
admin.password=password
mainDataLanguage=fr
 
collections=collection
collection.collection.languages=fr
collection.collection.modules=com.constellio.app.modules.rm.ConstellioRMModule
----

2.5 Téléchargement d'éléments externes

Startup

1
2
3
4
# Créer le fichier "Startup"
cd /opt/constellio
nano startup
chmod u+x /opt/constellio/startup

Wrapper

1
2
3
# Création du wrapper
cd /opt/constellio/conf
nano wrapper.conf

2.6 Création du service SOLR

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Dans le répertoire /opt, télécharger Solr dans ce répertoire
cd /opt
wget http://archive.apache.org/dist/lucene/solr/5.0.0/solr-5.0.0.tgz
tar -xvf solr-5.0.0.tgz
 
Renommer le répertoire solr-5.0.0 par solr 5
mv solr-5.0.0 solr
 
# Ajout le fichier solr.service dans le répertoire /usr/lib/systemd/system
nano /usr/lib/systemd/system/solr.service
 
----
[Unit]
Description=Solr
After=syslog.target network.target
 
[Service]
Type=forking
ExecStart=/opt/solr/bin/solr start -p 8983
 
[Install]
WantedBy=multi-user.target
----
 
# Modifier la mémoire allouée à Solr
nano /opt/solr/bin/solr.in.sh
 
# Remplacer
SOLR_JAVA_MEM="-Xms512m -Xmx512m"
 
# Par (maximum 4GB) :
OLR_JAVA_MEM="-Xms512m -Xmx4096m"
 
# Aller dans le répertoire configsetes
cd /opt/solr/server/solr/configsets
 
# Effacer les répertoires existants
rm -rf *_configs
 
# Copier les configurations solr
cp -r /opt/constellio/git/constellio/solrHome5/configsets/*_configs .
 
# Démarrer solr avec la commande
systemctl start solr

2.7 Installation de LibreOffice

1
2
3
4
5
6
7
8
9
# Installation de la librairie
yum install libXinerama cairo cups
 
# Récupérer la dernière version mature de LibreOffice en format RPM
cd /opt
wget http://downloadarchive.documentfoundation.org/libreoffice/
tar -xvf LibreOffice_*.tar.gz
rpm -ivh LibreOffice_*_rpm/RPMS/*.rpm
ln -s /opt/libreoffice/opt/libreoffice

2.8 Mémoire CONSTELLIO

1
2
# Lancer la commande (modifier 3072, selon la quantité de mémoire souhaitée en mégaoctets) :
sed -i "/wrapper.java.maxmemory=/c\wrapper.java.maxmemory=3072" /opt/constellio/conf/wrapper.conf 

2.9 Démarrage

1
2
# Lancer la commande
systemctl start constellio

2.10 Validation des services

1
2
3
 # Exécuter les commandes suivantes pour voir le statut des services
systemctl status solr
systemctl status constellio

2.11 Ouvrir le Firewall

1
2
3
4
 # Ajouter le port 8080 (si le pare-feu est configuré pour la zone : public)
# Exécuter les commandes suivantes pour paramétrer le pare-feu
firewall-cmd --zone=public --permanent --add-port=8080/tcp
firewall-cmd --reload

2.12 Trouver l'URL de Constellio

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 # Trouver l'adresse de l'hôte pour vous permettre de vous connectez à l'interface de Constellio
ifconfig
 
----
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 149.55.158.102  netmask <masked_value>  broadcast <masked_value>
        inet6 <masked_value>  prefixlen 64  scopeid 0x20<link>
        ether <masked_value>  txqueuelen 1000  (Ethernet)
        RX packets 1944657411  bytes 390078646667 (363.2 GiB)
        RX errors 0  dropped 363  overruns 0  frame 0
        TX packets 2563145542  bytes 4544278822689 (4.1 TiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet <masked_value>  netmask <masked_value>
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 269179646  bytes 358047741212 (333.4 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 269179646  bytes 358047741212 (333.4 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
----
 
# Noter l'adresse IP à la ligne 6, après "inet"

2.13 Se connecter à Constellio

1
2
 # Ouvrir un navigateur Web et saisir l'URL complet de la machine virtuelle (http://<hote>:8080/constellio) :
http://149.55.158.102:8080/constellio



Cet article vous a-t-il été utile ?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.