]> git.immae.eu Git - github/wallabag/wallabag.git/blame - docs/fr/user/installation.rst
Update doc
[github/wallabag/wallabag.git] / docs / fr / user / installation.rst
CommitLineData
4bf0d4e0
NL
1Installer wallabag
2==================
e6ebb14f
NL
3
4Pré-requis
89d95cdd
TC
5------------
6
eff75729 7wallabag est compatible avec PHP >= 5.5, PHP 7 inclus.
89d95cdd 8
eff75729 9Vous aurez besoin des extensions suivantes pour que wallabag fonctionne. Il est possible que certaines de ces extensions soient déjà activées dans votre version de PHP, donc vous n'avez pas forcément besoin d'installer tous les paquets correspondants.
89d95cdd
TC
10
11- php-session
12- php-ctype
13- php-dom
7bf4dd89 14- php-hash
89d95cdd
TC
15- php-simplexml
16- php-json
17- php-gd
18- php-mbstring
19- php-xml
20- php-tidy
21- php-iconv
22- php-curl
23- php-gettext
24- php-tokenizer
25
26wallabag utilise PDO afin de se connecter à une base de données, donc vous aurez besoin d'une extension et d'un système de bases de données parmi :
27
eff75729
NL
28- pdo_mysql
29- pdo_sqlite
30- pdo_pgsql
e6ebb14f
NL
31
32Installation
33------------
34
bba9907d
NL
35Sur un serveur dédié (méthode conseillée)
36~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37
8fed8d1b 38wallabag utilise un grand nombre de bibliothèques PHP pour fonctionner. Ces bibliothèques doivent être installées à l'aide d'un outil nommé Composer. Vous devez l'installer si ce n'est déjà fait et vous assurer que vous utilisez bien la version 1.2 (si vous avez déjà Composer, faite un ``composer selfupdate``).
89d95cdd
TC
39
40Installation de Composer :
e6ebb14f
NL
41
42::
43
44 curl -s http://getcomposer.org/installer | php
45
8fed8d1b 46Vous pouvez trouver des instructions spécifiques `ici (en anglais) <https://getcomposer.org/doc/00-intro.md>`__.
89d95cdd 47
8fed8d1b 48Pour installer wallabag, vous devez exécuter ces commandes :
e6ebb14f
NL
49
50::
51
c1181313
NL
52 git clone https://github.com/wallabag/wallabag.git
53 cd wallabag
ce0a3222 54 git checkout 2.1.0
f440e282 55 SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
8fdb5e57 56 php bin/console wallabag:install --env=prod
e6ebb14f 57
89d95cdd
TC
58Pour démarrer le serveur interne à php et vérifier que tout s'est installé correctement, vous pouvez exécuter :
59
60::
61
62 php bin/console server:run --env=prod
63
64Et accéder wallabag à l'adresse http://lipdevotreserveur:8000
65
bba9907d 66.. tip::
8846ad0a 67 Pour définir des paramètres via des variables d'environnement, vous pouvez les spécifier avec le préfixe ``SYMFONY__``. Par exemple, ``SYMFONY__DATABASE_DRIVER``. Vous pouvez lire `documentation Symfony <http://symfony.com/doc/current/cookbook/configuration/external_parameters.html>`__ pour en savoir plus.
7704ef5d 68
bba9907d
NL
69Sur un serveur mutualisé
70~~~~~~~~~~~~~~~~~~~~~~~~
71
72Nous mettons à votre disposition une archive avec toutes les dépendances à l'intérieur.
73La configuration par défaut utilise SQLite pour la base de données. Si vous souhaitez changer ces paramètres, vous devez modifier le fichier ``app/config/parameters.yml``.
74
75Nous avons déjà créé un utilisateur : le login et le mot de passe sont ``wallabag``.
76
e546a2d6 77.. caution:: Avec cette archive, wallabag ne vérifie pas si les extensions obligatoires sont présentes sur votre serveur pour bien fonctionner (ces vérifications sont faites durant le ``composer install`` quand vous avez un serveur dédié, voir ci-dessus).
bba9907d
NL
78
79Exécutez cette commande pour télécharger et décompresser l'archive :
80
81.. code-block:: bash
82
83 wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
84
9d360314 85(hash md5 de l'archive 2.1.0 : ``6c33520e29cc754b687f9cee0398dede``)
94d1dae4 86
e546a2d6 87Maintenant, lisez la documentation ci-dessous pour crééer un virtual host. Accédez ensuite à votre installation de wallabag.
bba9907d
NL
88Si vous avez changé la configuration pour modifier le type de stockage (MySQL ou PostgreSQL), vous devrez vous créer un utilisateur via la commande ``php bin/console wallabag:install --env=prod``.
89
90Installation avec Docker
89d95cdd
TC
91------------------------
92
bba9907d
NL
93Nous vous proposons une image Docker pour installer wallabag facilement. Allez voir du côté de `Docker Hub <https://hub.docker.com/r/wallabag/wallabag/>`__ pour plus d'informations.
94
95Commande pour démarrer le containeur
96~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97
98.. code-block:: bash
99
100 docker pull wallabag/wallabag
101
102Virtual hosts
103-------------
104
105Configuration avec Apache
106~~~~~~~~~~~~~~~~~~~~~~~~~
107
108En imaginant que vous vouliez installer wallabag dans le dossier ``/var/www/wallabag`` et que vous utilisiez PHP comme un module Apache, voici un vhost pour wallabag :
89d95cdd
TC
109
110::
111
112 <VirtualHost *:80>
113 ServerName domain.tld
114 ServerAlias www.domain.tld
115
116 DocumentRoot /var/www/wallabag/web
117 <Directory /var/www/wallabag/web>
118 AllowOverride None
119 Order Allow,Deny
120 Allow from All
121
122 <IfModule mod_rewrite.c>
123 Options -MultiViews
124 RewriteEngine On
125 RewriteCond %{REQUEST_FILENAME} !-f
126 RewriteRule ^(.*)$ app.php [QSA,L]
127 </IfModule>
128 </Directory>
129
130 # uncomment the following lines if you install assets as symlinks
131 # or run into problems when compiling LESS/Sass/CoffeScript assets
132 # <Directory /var/www/wallabag>
133 # Options FollowSymlinks
134 # </Directory>
135
136 # optionally disable the RewriteEngine for the asset directories
137 # which will allow apache to simply reply with a 404 when files are
138 # not found instead of passing the request into the full symfony stack
139 <Directory /var/www/wallabag/web/bundles>
140 <IfModule mod_rewrite.c>
141 RewriteEngine Off
142 </IfModule>
143 </Directory>
144 ErrorLog /var/log/apache2/wallabag_error.log
145 CustomLog /var/log/apache2/wallabag_access.log combined
146 </VirtualHost>
147
426bfdc3 148Après que vous ayez rechargé/redémarré Apache, vous devriez pouvoir avoir accès à wallabag à l'adresse http://domain.tld.
89d95cdd 149
bba9907d
NL
150Configuration avec Nginx
151~~~~~~~~~~~~~~~~~~~~~~~~
89d95cdd 152
bba9907d 153En imaginant que vous vouliez installer wallabag dans le dossier ``/var/www/wallabag``, voici un fichier de configuration Nginx pour wallabag :
89d95cdd
TC
154
155::
156
157 server {
158 server_name domain.tld www.domain.tld;
159 root /var/www/wallabag/web;
160
161 location / {
162 # try to serve file directly, fallback to app.php
163 try_files $uri /app.php$is_args$args;
164 }
165 location ~ ^/app\.php(/|$) {
166 fastcgi_pass unix:/var/run/php5-fpm.sock;
167 fastcgi_split_path_info ^(.+\.php)(/.*)$;
168 include fastcgi_params;
169 # When you are using symlinks to link the document root to the
170 # current version of your application, you should pass the real
171 # application path instead of the path to the symlink to PHP
172 # FPM.
173 # Otherwise, PHP's OPcache may not properly detect changes to
174 # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
175 # for more information).
176 fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
177 fastcgi_param DOCUMENT_ROOT $realpath_root;
178 # Prevents URIs that include the front controller. This will 404:
179 # http://domain.tld/app.php/some-path
180 # Remove the internal directive to allow URIs like this
181 internal;
182 }
183
184 error_log /var/log/nginx/wallabag_error.log;
185 access_log /var/log/nginx/wallabag_access.log;
186 }
187
426bfdc3 188Après que vous ayez rechargé/redémarré Nginx, vous devriez pouvoir avoir accès à wallabag à l'adresse http://domain.tld.
cea846d4 189
bba9907d 190.. tip::
cea846d4 191
61fcbe9f 192 Si vous voulez importer un fichier important dans wallabag, vous devez ajouter cette ligne dans votre configuration nginx ``client_max_body_size XM; # allows file uploads up to X megabytes``.
9ddf49ba 193
8b563fc0 194Configuration avec lighttpd
e546a2d6
NL
195~~~~~~~~~~~~~~~~~~~~~~~~~~~
196
8b563fc0 197En imaginant que vous vouliez installer wallabag dans le dossier ``/var/www/wallabag``, voici un fichier de configuration pour wallabag (éditez votre fichier ``lighttpd.conf`` collez-y cette configuration) :
e546a2d6
NL
198
199::
200
201 server.modules = (
8b563fc0
NL
202 "mod_fastcgi",
203 "mod_access",
204 "mod_alias",
205 "mod_compress",
206 "mod_redirect",
207 "mod_rewrite",
e546a2d6
NL
208 )
209 server.document-root = "/var/www/wallabag/web"
210 server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
211 server.errorlog = "/var/log/lighttpd/error.log"
212 server.pid-file = "/var/run/lighttpd.pid"
213 server.username = "www-data"
214 server.groupname = "www-data"
215 server.port = 80
216 server.follow-symlink = "enable"
217 index-file.names = ( "index.php", "index.html", "index.lighttpd.html")
218 url.access-deny = ( "~", ".inc" )
219 static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
220 compress.cache-dir = "/var/cache/lighttpd/compress/"
221 compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
222 include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
223 include_shell "/usr/share/lighttpd/create-mime.assign.pl"
224 include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
225 dir-listing.activate = "disable"
226
227 url.rewrite-if-not-file = (
8b563fc0
NL
228 "^/([^?])(?:\?(.))?" => "/app.php?$1&$2",
229 "^/([^?]*)" => "/app.php?=$1",
e546a2d6
NL
230 )
231
9ddf49ba
OD
232Droits d'accès aux dossiers du projet
233-------------------------------------
234
9ddf49ba
OD
235Environnement de test
236~~~~~~~~~~~~~~~~~~~~~
237
87b8461e 238Quand nous souhaitons juste tester wallabag, nous lançons simplement la commande ``php bin/console server:run --env=prod`` pour démarrer l'instance wallabag et tout se passe correctement car l'utilisateur qui a démarré le projet a accès naturellement au repertoire courant, tout va bien.
9ddf49ba 239
e546a2d6 240Environnement de production
9ddf49ba
OD
241~~~~~~~~~~~~~~~~~~~~~~~~~~~
242
87b8461e 243Dès lors que nous utilisons Apache ou Nginx pour accéder à notre instance wallabag, et non plus la commande ``php bin/console server:run --env=prod`` pour la démarrer, il faut prendre garde à octroyer les bons droits aux bons dossiers afin de préserver la sécurité de l'ensemble des fichiers fournis par le projet.
9ddf49ba
OD
244
245Aussi, le dossier, connu sous le nom de ``DocumentRoot`` (pour apache) ou ``root`` (pour Nginx), doit être impérativement accessible par l'utilisateur de Apache ou Nginx. Le nom de cet utilisateur est généralement ``www-data``, ``apache`` ou ``nobody`` (selon les systèmes linux utilisés).
246
247Donc le dossier ``/var/www/wallabag/web`` doit être accessible par ce dernier. Mais cela ne suffira pas si nous nous contentons de ce dossier, et nous pourrions avoir, au mieux une page blanche en accédant à la page d'accueil du projet, au pire une erreur 500.
248
249Cela est dû au fait qu'il faut aussi octroyer les mêmes droits d'accès au dossier ``/var/www/wallabag/var`` que ceux octroyés au dossier ``/var/www/wallabag/web``. Ainsi, on règle le problème par la commande suivante :
250
251.. code-block:: bash
252
253 chown -R www-data:www-data /var/www/wallabag/var
ab46a256
OD
254
255Il en est de même pour les dossiers suivants :
256
257* /var/www/wallabag/bin/
258* /var/www/wallabag/app/config/
259* /var/www/wallabag/vendor/
260
261en tapant
262
263.. code-block:: bash
264
265 chown -R www-data:www-data /var/www/wallabag/bin
266 chown -R www-data:www-data /var/www/wallabag/app/config
267 chown -R www-data:www-data /var/www/wallabag/vendor
268
269sinon lors de la mise à jour vous finirez par rencontrer les erreurs suivantes :
270
271
272.. code-block:: bash
273
274 Unable to write to the "bin" directory.
275 file_put_contents(app/config/parameters.yml): failed to open stream: Permission denied
276 file_put_contents(/.../wallabag/vendor/autoload.php): failed to open stream: Permission denied