]> git.immae.eu Git - github/wallabag/wallabag.git/blob - docs/en/user/installation.rst
Merge pull request #1824 from wallabag/v2-alternative-env
[github/wallabag/wallabag.git] / docs / en / user / installation.rst
1 Install wallabag
2 ================
3
4 Requirements
5 ------------
6
7 wallabag is compatible with PHP >= 5.5, including PHP 7.
8
9 You'll need the following extensions for wallabag to work. Some of these may already activated in your version of PHP, so you may not have to install all corresponding packages.
10
11 - php-session
12 - php-ctype
13 - php-dom
14 - php-hash
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
26 wallabag uses PDO to connect to database, so you'll need one of:
27
28 - pdo_mysql
29 - pdo_sqlite
30 - pdo_pgsql
31
32 and it's corresponding database server.
33
34 Installation
35 ------------
36
37 wallabag uses a big number of libraries in order to function. These libraries must be installed with a tool called Composer. You need to install it if you don't already have.
38
39 Install Composer:
40
41 ::
42
43 curl -s http://getcomposer.org/installer | php
44
45 You can find specific instructions here : __ https://getcomposer.org/doc/00-intro.md
46
47 To install wallabag itself, you must run these two commands:
48
49 ::
50
51 git clone https://github.com/wallabag/wallabag.git
52 cd wallabag
53 git checkout 2.0.0
54 SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
55 php bin/console wallabag:install --env=prod
56
57 To start php's build-in server and test if everything did install correctly, you can do:
58
59 ::
60
61 php bin/console server:run --env=prod
62
63 And access wallabag at http://yourserverip:8000
64
65 .. note::
66
67 To define parameters with environment variables, you have to set these variables with ``SYMFONY__`` prefix. For example, ``SYMFONY__DATABASE_DRIVER``. You can have a look to the `Symfony documentation
68 <http://symfony.com/doc/current/cookbook/configuration/external_parameters.html>`__.
69
70 Installing on Apache
71 --------------------
72
73 Assuming you install wallabag in the /var/www/wallabag folder and that you want to use php as an Apache module, here's a vhost for wallabag:
74
75 ::
76
77 <VirtualHost *:80>
78 ServerName domain.tld
79 ServerAlias www.domain.tld
80
81 DocumentRoot /var/www/wallabag/web
82 <Directory /var/www/wallabag/web>
83 AllowOverride None
84 Order Allow,Deny
85 Allow from All
86
87 <IfModule mod_rewrite.c>
88 Options -MultiViews
89 RewriteEngine On
90 RewriteCond %{REQUEST_FILENAME} !-f
91 RewriteRule ^(.*)$ app.php [QSA,L]
92 </IfModule>
93 </Directory>
94
95 # uncomment the following lines if you install assets as symlinks
96 # or run into problems when compiling LESS/Sass/CoffeScript assets
97 # <Directory /var/www/wallabag>
98 # Options FollowSymlinks
99 # </Directory>
100
101 # optionally disable the RewriteEngine for the asset directories
102 # which will allow apache to simply reply with a 404 when files are
103 # not found instead of passing the request into the full symfony stack
104 <Directory /var/www/wallabag/web/bundles>
105 <IfModule mod_rewrite.c>
106 RewriteEngine Off
107 </IfModule>
108 </Directory>
109 ErrorLog /var/log/apache2/wallabag_error.log
110 CustomLog /var/log/apache2/wallabag_access.log combined
111 </VirtualHost>
112
113 After reloading or restarting Apache, you should now be able to access wallabag at http://domain.tld.
114
115 Installing on Nginx
116 -------------------
117
118 Assuming you install wallabag in the /var/www/wallabag folder, here's the recipe for wallabag :
119
120 ::
121
122 server {
123 server_name domain.tld www.domain.tld;
124 root /var/www/wallabag/web;
125
126 location / {
127 # try to serve file directly, fallback to app.php
128 try_files $uri /app.php$is_args$args;
129 }
130 location ~ ^/app\.php(/|$) {
131 fastcgi_pass unix:/var/run/php5-fpm.sock;
132 fastcgi_split_path_info ^(.+\.php)(/.*)$;
133 include fastcgi_params;
134 # When you are using symlinks to link the document root to the
135 # current version of your application, you should pass the real
136 # application path instead of the path to the symlink to PHP
137 # FPM.
138 # Otherwise, PHP's OPcache may not properly detect changes to
139 # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
140 # for more information).
141 fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
142 fastcgi_param DOCUMENT_ROOT $realpath_root;
143 # Prevents URIs that include the front controller. This will 404:
144 # http://domain.tld/app.php/some-path
145 # Remove the internal directive to allow URIs like this
146 internal;
147 }
148
149 error_log /var/log/nginx/wallabag_error.log;
150 access_log /var/log/nginx/wallabag_access.log;
151 }
152
153 After reloading or restarting nginx, you should now be able to access wallabag at http://domain.tld.