]> git.immae.eu Git - github/wallabag/wallabag.git/blame - docs/fr/user/installation.rst
manage assets through npm
[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
89d95cdd
TC
38wallabag utilise un grand nombre de bibliothèques 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.
39
40Installation de Composer :
e6ebb14f
NL
41
42::
43
44 curl -s http://getcomposer.org/installer | php
45
8846ad0a 46Vous pouvez trouver des instructions spécifiques `ici (en anglais) <https://getcomposer.org/doc/00-intro.md>`__ :
89d95cdd 47
426bfdc3 48Pour installer wallabag, vous devez exécuter ces deux commandes :
e6ebb14f
NL
49
50::
51
c1181313
NL
52 git clone https://github.com/wallabag/wallabag.git
53 cd wallabag
5ecdfcd0 54 git checkout 2.0.5
c1181313 55 SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
e6ebb14f
NL
56 php bin/console wallabag:install --env=prod
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
e546a2d6 85Maintenant, lisez la documentation ci-dessous pour crééer un virtual host. Accédez ensuite à votre installation de wallabag.
bba9907d
NL
86Si 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``.
87
88Installation avec Docker
89d95cdd
TC
89------------------------
90
bba9907d
NL
91Nous 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.
92
93Commande pour démarrer le containeur
94~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95
96.. code-block:: bash
97
98 docker pull wallabag/wallabag
99
100Virtual hosts
101-------------
102
103Configuration avec Apache
104~~~~~~~~~~~~~~~~~~~~~~~~~
105
106En 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
107
108::
109
110 <VirtualHost *:80>
111 ServerName domain.tld
112 ServerAlias www.domain.tld
113
114 DocumentRoot /var/www/wallabag/web
115 <Directory /var/www/wallabag/web>
116 AllowOverride None
117 Order Allow,Deny
118 Allow from All
119
120 <IfModule mod_rewrite.c>
121 Options -MultiViews
122 RewriteEngine On
123 RewriteCond %{REQUEST_FILENAME} !-f
124 RewriteRule ^(.*)$ app.php [QSA,L]
125 </IfModule>
126 </Directory>
127
128 # uncomment the following lines if you install assets as symlinks
129 # or run into problems when compiling LESS/Sass/CoffeScript assets
130 # <Directory /var/www/wallabag>
131 # Options FollowSymlinks
132 # </Directory>
133
134 # optionally disable the RewriteEngine for the asset directories
135 # which will allow apache to simply reply with a 404 when files are
136 # not found instead of passing the request into the full symfony stack
137 <Directory /var/www/wallabag/web/bundles>
138 <IfModule mod_rewrite.c>
139 RewriteEngine Off
140 </IfModule>
141 </Directory>
142 ErrorLog /var/log/apache2/wallabag_error.log
143 CustomLog /var/log/apache2/wallabag_access.log combined
144 </VirtualHost>
145
426bfdc3 146Après que vous ayez rechargé/redémarré Apache, vous devriez pouvoir avoir accès à wallabag à l'adresse http://domain.tld.
89d95cdd 147
bba9907d
NL
148Configuration avec Nginx
149~~~~~~~~~~~~~~~~~~~~~~~~
89d95cdd 150
bba9907d 151En imaginant que vous vouliez installer wallabag dans le dossier ``/var/www/wallabag``, voici un fichier de configuration Nginx pour wallabag :
89d95cdd
TC
152
153::
154
155 server {
156 server_name domain.tld www.domain.tld;
157 root /var/www/wallabag/web;
158
159 location / {
160 # try to serve file directly, fallback to app.php
161 try_files $uri /app.php$is_args$args;
162 }
163 location ~ ^/app\.php(/|$) {
164 fastcgi_pass unix:/var/run/php5-fpm.sock;
165 fastcgi_split_path_info ^(.+\.php)(/.*)$;
166 include fastcgi_params;
167 # When you are using symlinks to link the document root to the
168 # current version of your application, you should pass the real
169 # application path instead of the path to the symlink to PHP
170 # FPM.
171 # Otherwise, PHP's OPcache may not properly detect changes to
172 # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
173 # for more information).
174 fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
175 fastcgi_param DOCUMENT_ROOT $realpath_root;
176 # Prevents URIs that include the front controller. This will 404:
177 # http://domain.tld/app.php/some-path
178 # Remove the internal directive to allow URIs like this
179 internal;
180 }
181
182 error_log /var/log/nginx/wallabag_error.log;
183 access_log /var/log/nginx/wallabag_access.log;
184 }
185
426bfdc3 186Après que vous ayez rechargé/redémarré Nginx, vous devriez pouvoir avoir accès à wallabag à l'adresse http://domain.tld.
cea846d4 187
bba9907d 188.. tip::
cea846d4 189
61fcbe9f 190 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 191
8b563fc0 192Configuration avec lighttpd
e546a2d6
NL
193~~~~~~~~~~~~~~~~~~~~~~~~~~~
194
8b563fc0 195En 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
196
197::
198
199 server.modules = (
8b563fc0
NL
200 "mod_fastcgi",
201 "mod_access",
202 "mod_alias",
203 "mod_compress",
204 "mod_redirect",
205 "mod_rewrite",
e546a2d6
NL
206 )
207 server.document-root = "/var/www/wallabag/web"
208 server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
209 server.errorlog = "/var/log/lighttpd/error.log"
210 server.pid-file = "/var/run/lighttpd.pid"
211 server.username = "www-data"
212 server.groupname = "www-data"
213 server.port = 80
214 server.follow-symlink = "enable"
215 index-file.names = ( "index.php", "index.html", "index.lighttpd.html")
216 url.access-deny = ( "~", ".inc" )
217 static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
218 compress.cache-dir = "/var/cache/lighttpd/compress/"
219 compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
220 include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
221 include_shell "/usr/share/lighttpd/create-mime.assign.pl"
222 include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
223 dir-listing.activate = "disable"
224
225 url.rewrite-if-not-file = (
8b563fc0
NL
226 "^/([^?])(?:\?(.))?" => "/app.php?$1&$2",
227 "^/([^?]*)" => "/app.php?=$1",
e546a2d6
NL
228 )
229
9ddf49ba
OD
230Droits d'accès aux dossiers du projet
231-------------------------------------
232
9ddf49ba
OD
233Environnement de test
234~~~~~~~~~~~~~~~~~~~~~
235
87b8461e 236Quand 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 237
e546a2d6 238Environnement de production
9ddf49ba
OD
239~~~~~~~~~~~~~~~~~~~~~~~~~~~
240
87b8461e 241Dè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
242
243Aussi, 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).
244
245Donc 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.
246
247Cela 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 :
248
249.. code-block:: bash
250
251 chown -R www-data:www-data /var/www/wallabag/var
ab46a256
OD
252
253Il en est de même pour les dossiers suivants :
254
255* /var/www/wallabag/bin/
256* /var/www/wallabag/app/config/
257* /var/www/wallabag/vendor/
258
259en tapant
260
261.. code-block:: bash
262
263 chown -R www-data:www-data /var/www/wallabag/bin
264 chown -R www-data:www-data /var/www/wallabag/app/config
265 chown -R www-data:www-data /var/www/wallabag/vendor
266
267sinon lors de la mise à jour vous finirez par rencontrer les erreurs suivantes :
268
269
270.. code-block:: bash
271
272 Unable to write to the "bin" directory.
273 file_put_contents(app/config/parameters.yml): failed to open stream: Permission denied
274 file_put_contents(/.../wallabag/vendor/autoload.php): failed to open stream: Permission denied