Projet

Général

Profil

8 » Historique » Version 57

Patrice Nadeau, 2018-04-07 14:59

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 57 Patrice Nadeau
76
```bash
77 5 Patrice Nadeau
<VirtualHost *:80>
78 56 Patrice Nadeau
79 5 Patrice Nadeau
#    Servername www.toto.com
80
    DocumentRoot /srv/www/htdocs/drupal2
81
    ServerAdmin toto@toto.com
82
    <Directory "/srv/www/htdocs/drupal2">
83
        Options Indexes ExecCGI FollowSymLinks
84
        AllowOverride All
85
        Require all granted
86
    </Directory>
87
</VirtualHost>
88 56 Patrice Nadeau
```
89 53 Patrice Nadeau
## Installation
90 2 Patrice Nadeau
91
https://www.drupal.org/upgrade/migrate
92 1 Patrice Nadeau
93 12 Patrice Nadeau
Sur le serveur :
94 55 Patrice Nadeau
95
```bash
96
97 1 Patrice Nadeau
# Téléchargement
98 2 Patrice Nadeau
cd /srv/www/htdocs
99
wget http://ftp.drupal.org/files/projects/drupal-8.0.2.tar.gz
100
tar -xvf drupal-8.0.2.tar.gz
101
mv drupal-8.0.2 drupal2
102 12 Patrice Nadeau
# Changement de la sécurité
103 2 Patrice Nadeau
chown wwwrun:www -R drupal2
104
</code></pre>
105 1 Patrice Nadeau
106
À partir d'un navigateur internet, allez au http://serveur.tld/drupal2
107 13 Patrice Nadeau
108 53 Patrice Nadeau
## Mise à niveau d'une version précédente (7.x)
109 13 Patrice Nadeau
110 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
111 1 Patrice Nadeau
112 15 Patrice Nadeau
Une fois l'installation de base faite, Installer le module _Migrate Upgrade_
113
<pre><code class="bash">
114 16 Patrice Nadeau
cd /srv/www/htdocs/drupal2/modules
115 1 Patrice Nadeau
wget https://ftp.drupal.org/files/projects/migrate_upgrade-8.x-1.x-dev.tar.gz
116 16 Patrice Nadeau
tar -xvf migrate_upgrade-8.x-1.x-dev.tar.gz
117
rm migrate_upgrade-8.x-1.x-dev.tar.gz
118 15 Patrice Nadeau
</code></pre>
119 17 Patrice Nadeau
120
Dans la page d'administration de Drupal, activer le module.
121 19 Patrice Nadeau
122 53 Patrice Nadeau
## Rapports d’état
123 1 Patrice Nadeau
124 30 Patrice Nadeau
Reports, Status Report
125 24 Patrice Nadeau
126 53 Patrice Nadeau
### Trusted Host Settings 
127 19 Patrice Nadeau
128 1 Patrice Nadeau
Modifier le fichier _sites/default/settings.php_, à partir des exemples de la section *trusted_host_patterns*.
129 24 Patrice Nadeau
130 53 Patrice Nadeau
### Upload progress 
131 24 Patrice Nadeau
132 30 Patrice Nadeau
Si le module n'est pas actif, faire la désinstallation :
133 24 Patrice Nadeau
<pre><code class="bash">
134 25 Patrice Nadeau
pecl uninstall uploadprogress
135 24 Patrice Nadeau
</code></pre>
136
137
Refaire l'installation (voir les instructions plus haut)
138 26 Patrice Nadeau
139 53 Patrice Nadeau
### Twig C extension 
140 26 Patrice Nadeau
141 27 Patrice Nadeau
> http://drupal.stackexchange.com/questions/162574/twig-c-extension-in-drupal-8
142 26 Patrice Nadeau
143
<pre><code class="bash">
144
zypper install php5-phar
145
</code></pre>
146
147
<pre><code class="bash">
148
# Installe composer
149
cd /srv/www/htdocs/drupal2/vendor
150
# Installe twig
151
./composer.phar require twig/twig:~1.0
152 28 Patrice Nadeau
# Déplace le dossier au bon endroit
153
mv vendor/twig/twig/ext twig/twig/
154
# Nettoyage
155
rm -r vendor/
156 29 Patrice Nadeau
# Se placer dans le bon repertoire
157 28 Patrice Nadeau
cd twig/twig/ext/twig
158 29 Patrice Nadeau
# Lancer la compilation
159
phpize
160
./configure
161 1 Patrice Nadeau
make
162 29 Patrice Nadeau
make install
163
# Relire Apache
164
systemctl reload apache2.service
165 1 Patrice Nadeau
</code></pre>
166 26 Patrice Nadeau
167 53 Patrice Nadeau
## Mise à jour
168 33 Patrice Nadeau
169
> Version 8.3.1
170 52 Patrice Nadeau
171 45 Patrice Nadeau
> S'assurer d'avoir une copie de la base de données et du répertoire de Drupal.
172 38 Patrice Nadeau
173 53 Patrice Nadeau
*  À partir du site, mettre le site en mode maintenance
174
    * Configuration, Development, Maintenance Mode
175
* A partir de la ligne de commande sur le serveur, télécharger la nouvelle version et l'installer
176
177
```bash
178 35 Patrice Nadeau
cd /srv/www/htdocs
179 52 Patrice Nadeau
wget https://ftp.drupal.org/files/projects/drupal-8.3.1.tar.gz
180
tar xvf drupal-8.3.1.tar.gz
181
cp -R drupal-8.3.1/* drupal-8.3.1/.htaccess drupal
182 53 Patrice Nadeau
```
183
* Exécuter la mise à jour à partir du navigateur
184
    * http://fqdn/drupal/update.php
185
* Remettre le site en ligne