]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - doc/Server-configuration.html
Bump version to v0.9.0
[github/shaarli/Shaarli.git] / doc / Server-configuration.html
index 068900b88ee35484b05adf831c30e55881f07712..0e6b220a6cab29241fcf27e51b1b196ba0bb2201 100644 (file)
@@ -69,6 +69,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
 <li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
 <li><a href="Firefox-share.html">Firefox share</a></li>
 <li><a href="RSS-feeds.html">RSS feeds</a></li>
+<li><a href="REST-API.html">REST API</a></li>
 </ul></li>
 <li>How To
 <ul>
@@ -87,6 +88,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
 <li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
 <li><a href="Plugin-System.html">Plugin System</a></li>
 <li><a href="Release-Shaarli.html">Release Shaarli</a></li>
+<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
 <li><a href="Security.html">Security</a></li>
 <li><a href="Static-analysis.html">Static analysis</a></li>
 <li><a href="Theming.html">Theming</a></li>
@@ -193,6 +195,10 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
     ErrorLog<span class="st">  /var/log/apache2/shaarli-error.log</span>
     CustomLog<span class="st"> /var/log/apache2/shaarli-access.log combined</span>
 <span class="fu">&lt;/VirtualHost&gt;</span></code></pre></div>
+<h3 id="htaccess">.htaccess</h3>
+<p>Shaarli use <code>.htaccess</code> Apache files to deny access to files that shouldn't be directly accessed (datastore, config, etc.). You need the directive <code>AllowOverride All</code> in your virtual host configuration for them to work.</p>
+<p><strong>Warning</strong>: If you use Apache 2.2 or lower, you need <a href="https://httpd.apache.org/docs/current/mod/mod_version.html">mod_version</a> to be installed and enabled.<a href=".html"></a></p>
+<p>Apache module <code>mod_rewrite</code> <strong>must</strong> be enabled to use the REST API. URL rewriting rules for the Slim microframework are stated in the root <code>.htaccess</code> file.</p>
 <h2 id="lighthttpd">LightHttpd</h2>
 <h2 id="nginx">Nginx</h2>
 <h3 id="foreword">Foreword</h3>
@@ -233,7 +239,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
 <li>files may be located in a user's home directory</li>
 <li>in this case, make sure both Nginx and PHP-FPM are running as the local user/group!</li>
 </ul>
-<p>For all following examples, a development configuration will be used:</p>
+<p>For all following configuration examples, this user/group pair will be used:</p>
 <ul>
 <li><code>user:group = john:users</code>,</li>
 </ul>
@@ -251,6 +257,24 @@ user john users;
 http {
     [...][](.html)
 }</code></pre>
+<h3 id="optional-increase-the-maximum-file-upload-size">(Optional) Increase the maximum file upload size</h3>
+<p>Some bookmark dumps generated by web browsers can be <em>huge</em> due to the presence of Base64-encoded images and favicons, as well as extra verbosity when nesting links in (sub-)folders.</p>
+<p>To increase upload size, you will need to modify both nginx and PHP configuration:</p>
+<pre class="nginx"><code># /etc/nginx/nginx.conf
+
+http {
+    [...][](.html)
+
+    client_max_body_size 10m;
+
+    [...][](.html)
+}</code></pre>
+<div class="sourceCode"><pre class="sourceCode ini"><code class="sourceCode ini"><span class="co"># /etc/php5/fpm/php.ini</span>
+
+<span class="kw">[...][]</span><span class="dt">(.html)</span>
+<span class="dt">post_max_size </span><span class="ot">=</span><span class="st"> 10M</span>
+<span class="kw">[...][]</span><span class="dt">(.html)</span>
+<span class="dt">upload_max_filesize </span><span class="ot">=</span><span class="st"> 10M</span></code></pre></div>
 <h3 id="minimal-1">Minimal</h3>
 <p><em>WARNING: Use for development only!</em></p>
 <pre class="nginx"><code>user john users;
@@ -275,11 +299,14 @@ http {
         error_log   /var/log/nginx/error.log;
 
         location /shaarli/ {
+            try_files $uri /shaarli/index.php$is_args$args;
             access_log  /var/log/nginx/shaarli.access.log;
             error_log   /var/log/nginx/shaarli.error.log;
         }
 
         location ~ (index)\.php$ {
+            try_files $uri =404;
+            fastcgi_split_path_info ^(.+\.php)(/.+)$;
             fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
             fastcgi_index  index.php;
             include        fastcgi.conf;
@@ -314,6 +341,10 @@ location ~ ~$ {
 }</code></pre>
 <pre class="nginx"><code># /etc/nginx/php.conf
 location ~ (index)\.php$ {
+    # Slim - split URL path into (script_filename, path_info)
+    try_files $uri =404;
+    fastcgi_split_path_info ^(.+\.php)(/.+)$;
+
     # filter and proxy PHP requests to PHP-FPM
     fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
     fastcgi_index  index.php;
@@ -346,10 +377,18 @@ http {
         server_name  my.first.domain.org;
 
         location /shaarli/ {
+            # Slim - rewrite URLs
+            try_files $uri /shaarli/index.php$is_args$args;
+
             access_log  /var/log/nginx/shaarli.access.log;
             error_log   /var/log/nginx/shaarli.error.log;
         }
 
+        location = /shaarli/favicon.ico {
+            # serve the Shaarli favicon from its custom location
+            alias /var/www/shaarli/images/favicon.ico;
+        }
+
         include deny.conf;
         include static_assets.conf;
         include php.conf;
@@ -399,10 +438,18 @@ http {
         ssl_certificate_key  /home/john/ssl/localhost.key;
 
         location /shaarli/ {
+            # Slim - rewrite URLs
+            try_files $uri /index.php$is_args$args;
+
             access_log  /var/log/nginx/shaarli.access.log;
             error_log   /var/log/nginx/shaarli.error.log;
         }
 
+        location = /shaarli/favicon.ico {
+            # serve the Shaarli favicon from its custom location
+            alias /var/www/shaarli/images/favicon.ico;
+        }
+
         include deny.conf;
         include static_assets.conf;
         include php.conf;