Projet

Général

Profil

8 » Historique » Version 56

Patrice Nadeau, 2018-04-07 14:58

1 53 Patrice Nadeau
# Drupal 8
2 2 Patrice Nadeau
3 46 Patrice Nadeau
> Drupal 8.2.1 sous openSUSE Leap 42.1
4 4 Patrice Nadeau
5 32 Patrice Nadeau
{{lastupdated_at}} {{lastupdated_by}}
6
7
---
8
9
{{TOC}}
10
11
12 53 Patrice Nadeau
## Pre-requis
13 7 Patrice Nadeau
14 53 Patrice Nadeau
### Module facultatif
15 1 Patrice Nadeau
16 18 Patrice Nadeau
Modules PHP facultatifs : 
17 54 Patrice Nadeau
18 18 Patrice Nadeau
* PHP OPcache
19
* cURl : pour le module Drupal _Aggregator_
20 21 Patrice Nadeau
* Upload progress
21 1 Patrice Nadeau
22
Installation
23 54 Patrice Nadeau
24
```bash
25 1 Patrice Nadeau
zypper install php5-opcache php5-curl
26 11 Patrice Nadeau
pecl install uploadprogress
27 54 Patrice Nadeau
```
28 1 Patrice Nadeau
29 54 Patrice Nadeau
30 11 Patrice Nadeau
Ajouter dans le fichier _/etc/php/apache2/php.ini_
31 54 Patrice Nadeau
32
```php
33 1 Patrice Nadeau
extension=opcache.so
34
extension=uploadprogress.so
35 54 Patrice Nadeau
```
36 1 Patrice Nadeau
37 54 Patrice Nadeau
38 1 Patrice Nadeau
S'assurer que _mod_php_ est actif
39 54 Patrice Nadeau
40
```bash
41 22 Patrice Nadeau
a2enmod mod_php
42 54 Patrice Nadeau
```
43 22 Patrice Nadeau
44
Relire la configuration Apache
45 54 Patrice Nadeau
46
```bash
47 11 Patrice Nadeau
systemctl reload apache2.service
48 54 Patrice Nadeau
```
49 7 Patrice Nadeau
50 8 Patrice Nadeau
### MySQL/MariaDB
51 1 Patrice Nadeau
52
Choisir et noter les 3 items suivants :
53 8 Patrice Nadeau
* _drupal_db_ : nom voulu de la base de donnés de Drupal
54
* _drupal_user_ : nom voulu pour l’usager MySQL
55
* _drupal_password_ : mot de passe voulu pour l’usager MySQL
56
57
À partir du serveur :
58
> root est l’usager « root » de MySQL
59
60 54 Patrice Nadeau
```bash
61 8 Patrice Nadeau
mysql -u root -p
62 54 Patrice Nadeau
```
63 8 Patrice Nadeau
64
Inscrire les commandes SQL suivantes :
65
<pre><code class="sql">
66
create database drupal_db character set utf8;
67
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON drupal_db.* TO 'drupal_user'@'localhost' IDENTIFIED BY 'drupal_password';
68
COMMIT;
69
quit;
70
</code></pre>
71
72 53 Patrice Nadeau
### Apache
73 7 Patrice Nadeau
74 5 Patrice Nadeau
_/etc/apache2/vhosts.d/vhost.conf_
75
<pre><code class="bash">
76
<VirtualHost *:80>
77 56 Patrice Nadeau
78 5 Patrice Nadeau
#    Servername www.toto.com
79
    DocumentRoot /srv/www/htdocs/drupal2
80
    ServerAdmin toto@toto.com
81
    <Directory "/srv/www/htdocs/drupal2">
82
        Options Indexes ExecCGI FollowSymLinks
83
        AllowOverride All
84
        Require all granted
85
    </Directory>
86
</VirtualHost>
87 56 Patrice Nadeau
```
88 53 Patrice Nadeau
## Installation
89 2 Patrice Nadeau
90
https://www.drupal.org/upgrade/migrate
91 1 Patrice Nadeau
92 12 Patrice Nadeau
Sur le serveur :
93 55 Patrice Nadeau
94
```bash
95
96 1 Patrice Nadeau
# Téléchargement
97 2 Patrice Nadeau
cd /srv/www/htdocs
98
wget http://ftp.drupal.org/files/projects/drupal-8.0.2.tar.gz
99
tar -xvf drupal-8.0.2.tar.gz
100
mv drupal-8.0.2 drupal2
101 12 Patrice Nadeau
# Changement de la sécurité
102 2 Patrice Nadeau
chown wwwrun:www -R drupal2
103
</code></pre>
104 1 Patrice Nadeau
105
À partir d'un navigateur internet, allez au http://serveur.tld/drupal2
106 13 Patrice Nadeau
107 53 Patrice Nadeau
## Mise à niveau d'une version précédente (7.x)
108 13 Patrice Nadeau
109 15 Patrice Nadeau
> Une nouvelle installation de Drupal 8 doit être faite et ensuite une migration vers le nouveau site seras effectué. https://www.drupal.org/node/2257723
110 1 Patrice Nadeau
111 15 Patrice Nadeau
Une fois l'installation de base faite, Installer le module _Migrate Upgrade_
112
<pre><code class="bash">
113 16 Patrice Nadeau
cd /srv/www/htdocs/drupal2/modules
114 1 Patrice Nadeau
wget https://ftp.drupal.org/files/projects/migrate_upgrade-8.x-1.x-dev.tar.gz
115 16 Patrice Nadeau
tar -xvf migrate_upgrade-8.x-1.x-dev.tar.gz
116
rm migrate_upgrade-8.x-1.x-dev.tar.gz
117 15 Patrice Nadeau
</code></pre>
118 17 Patrice Nadeau
119
Dans la page d'administration de Drupal, activer le module.
120 19 Patrice Nadeau
121 53 Patrice Nadeau
## Rapports d’état
122 1 Patrice Nadeau
123 30 Patrice Nadeau
Reports, Status Report
124 24 Patrice Nadeau
125 53 Patrice Nadeau
### Trusted Host Settings 
126 19 Patrice Nadeau
127 1 Patrice Nadeau
Modifier le fichier _sites/default/settings.php_, à partir des exemples de la section *trusted_host_patterns*.
128 24 Patrice Nadeau
129 53 Patrice Nadeau
### Upload progress 
130 24 Patrice Nadeau
131 30 Patrice Nadeau
Si le module n'est pas actif, faire la désinstallation :
132 24 Patrice Nadeau
<pre><code class="bash">
133 25 Patrice Nadeau
pecl uninstall uploadprogress
134 24 Patrice Nadeau
</code></pre>
135
136
Refaire l'installation (voir les instructions plus haut)
137 26 Patrice Nadeau
138 53 Patrice Nadeau
### Twig C extension 
139 26 Patrice Nadeau
140 27 Patrice Nadeau
> http://drupal.stackexchange.com/questions/162574/twig-c-extension-in-drupal-8
141 26 Patrice Nadeau
142
<pre><code class="bash">
143
zypper install php5-phar
144
</code></pre>
145
146
<pre><code class="bash">
147
# Installe composer
148
cd /srv/www/htdocs/drupal2/vendor
149
# Installe twig
150
./composer.phar require twig/twig:~1.0
151 28 Patrice Nadeau
# Déplace le dossier au bon endroit
152
mv vendor/twig/twig/ext twig/twig/
153
# Nettoyage
154
rm -r vendor/
155 29 Patrice Nadeau
# Se placer dans le bon repertoire
156 28 Patrice Nadeau
cd twig/twig/ext/twig
157 29 Patrice Nadeau
# Lancer la compilation
158
phpize
159
./configure
160 1 Patrice Nadeau
make
161 29 Patrice Nadeau
make install
162
# Relire Apache
163
systemctl reload apache2.service
164 1 Patrice Nadeau
</code></pre>
165 26 Patrice Nadeau
166 53 Patrice Nadeau
## Mise à jour
167 33 Patrice Nadeau
168
> Version 8.3.1
169 52 Patrice Nadeau
170 45 Patrice Nadeau
> S'assurer d'avoir une copie de la base de données et du répertoire de Drupal.
171 38 Patrice Nadeau
172 53 Patrice Nadeau
*  À partir du site, mettre le site en mode maintenance
173
    * Configuration, Development, Maintenance Mode
174
* A partir de la ligne de commande sur le serveur, télécharger la nouvelle version et l'installer
175
176
```bash
177 35 Patrice Nadeau
cd /srv/www/htdocs
178 52 Patrice Nadeau
wget https://ftp.drupal.org/files/projects/drupal-8.3.1.tar.gz
179
tar xvf drupal-8.3.1.tar.gz
180
cp -R drupal-8.3.1/* drupal-8.3.1/.htaccess drupal
181 53 Patrice Nadeau
```
182
* Exécuter la mise à jour à partir du navigateur
183
    * http://fqdn/drupal/update.php
184
* Remettre le site en ligne