MyShaarli/doc/html/Troubleshooting/index.html
2017-06-18 06:32:30 +02:00

429 lines
19 KiB
HTML

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Troubleshooting - Shaarli Documentation</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../css/theme.css" type="text/css" />
<link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
<link rel="stylesheet" href="../css/highlight.css">
<link href="../github-markdown.css" rel="stylesheet">
<script>
// Current page data
var mkdocs_page_name = "Troubleshooting";
var mkdocs_page_input_path = "Troubleshooting.md";
var mkdocs_page_url = "/Troubleshooting/";
</script>
<script src="../js/jquery-2.1.1.min.js"></script>
<script src="../js/modernizr-2.8.3.min.js"></script>
<script type="text/javascript" src="../js/highlight.pack.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> Shaarli Documentation</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1">
<a class="" href="..">Home</a>
</li>
<li class="toctree-l1">
<span class="caption-text">Setup</span>
<ul class="subnav">
<li class="">
<a class="" href="../Download-and-Installation/">Download and Installation</a>
</li>
<li class="">
<a class="" href="../Upgrade-and-migration/">Upgrade and migration</a>
</li>
<li class="">
<a class="" href="../Server-requirements/">Server requirements</a>
</li>
<li class="">
<a class="" href="../Server-configuration/">Server configuration</a>
</li>
<li class="">
<a class="" href="../Server-security/">Server security</a>
</li>
<li class="">
<a class="" href="../Shaarli-configuration/">Shaarli configuration</a>
</li>
<li class="">
<a class="" href="../Plugins/">Plugins</a>
</li>
</ul>
</li>
<li class="toctree-l1">
<span class="caption-text">Docker</span>
<ul class="subnav">
<li class="">
<a class="" href="../Docker-101/">Docker 101</a>
</li>
<li class="">
<a class="" href="../Shaarli-images/">Shaarli images</a>
</li>
<li class="">
<a class="" href="../Reverse-proxy-configuration/">Reverse proxy configuration</a>
</li>
<li class="">
<a class="" href="../Docker-resources/">Docker resources</a>
</li>
</ul>
</li>
<li class="toctree-l1">
<span class="caption-text">Usage</span>
<ul class="subnav">
<li class="">
<a class="" href="../Features/">Features</a>
</li>
<li class="">
<a class="" href="../Bookmarklet/">Bookmarklet</a>
</li>
<li class="">
<a class="" href="../Browsing-and-searching/">Browsing and searching</a>
</li>
<li class="">
<a class="" href="../Firefox-share/">Firefox share</a>
</li>
<li class="">
<a class="" href="../RSS-feeds/">RSS feeds</a>
</li>
<li class="">
<a class="" href="../REST-API/">REST API</a>
</li>
</ul>
</li>
<li class="toctree-l1">
<span class="caption-text">How To</span>
<ul class="subnav">
<li class="">
<a class="" href="../Backup,-restore,-import-and-export/">Backup, restore, import and export</a>
</li>
<li class="">
<a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="current" href="./">Troubleshooting</a>
<ul class="subnav">
<li class="toctree-l2"><a href="#troubleshooting">Troubleshooting</a></li>
<ul>
<li><a class="toctree-l3" href="#browser">Browser</a></li>
<li><a class="toctree-l3" href="#login">Login</a></li>
<li><a class="toctree-l3" href="#hosting-problems">Hosting problems</a></li>
<li><a class="toctree-l3" href="#sessions-do-not-seem-to-work-correctly-on-your-server">Sessions do not seem to work correctly on your server</a></li>
</ul>
</ul>
</li>
<li class="toctree-l1">
<span class="caption-text">Development</span>
<ul class="subnav">
<li class="">
<a class="" href="../Development-guidelines/">Development guidelines</a>
</li>
<li class="">
<a class="" href="../Continuous-integration-tools/">Continuous integration tools</a>
</li>
<li class="">
<a class="" href="../GnuPG-signature/">GnuPG signature</a>
</li>
<li class="">
<a class="" href="../Coding-guidelines/">Coding guidelines</a>
</li>
<li class="">
<a class="" href="../Directory-structure/">Directory structure</a>
</li>
<li class="">
<a class="" href="../3rd-party-libraries/">3rd party libraries</a>
</li>
<li class="">
<a class="" href="../Plugin-System/">Plugin System</a>
</li>
<li class="">
<a class="" href="../Release-Shaarli/">Release Shaarli</a>
</li>
<li class="">
<a class="" href="../Versioning-and-Branches/">Versioning and Branches</a>
</li>
<li class="">
<a class="" href="../Security/">Security</a>
</li>
<li class="">
<a class="" href="../Static-analysis/">Static analysis</a>
</li>
<li class="">
<a class="" href="../Theming/">Theming</a>
</li>
<li class="">
<a class="" href="../Unit-tests/">Unit tests</a>
</li>
</ul>
</li>
<li class="toctree-l1">
<span class="caption-text">About</span>
<ul class="subnav">
<li class="">
<a class="" href="../FAQ/">FAQ</a>
</li>
<li class="">
<a class="" href="../Community-&-Related-software/">Community & Related software</a>
</li>
</ul>
</li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">Shaarli Documentation</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="..">Docs</a> &raquo;</li>
<li>Troubleshooting</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/shaarli/Shaarli/edit/master/docs/Troubleshooting.md"
class="icon icon-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<h1 id="troubleshooting">Troubleshooting</h1>
<h2 id="browser">Browser</h2>
<h3 id="redirection-issues-http-referer">Redirection issues (HTTP Referer)</h3>
<p>Depending on its configuration and installed plugins, the browser may remove or alter (spoof) HTTP referers, thus preventing Shaarli from properly redirecting between pages.</p>
<p>See:
- <a href="https://en.wikipedia.org/wiki/HTTP_referer">HTTP referer</a> (Wikipedia)
- <a href="http://www.ghacks.net/2015/01/22/improve-online-privacy-by-controlling-referrer-information/">Improve online privacy by controlling referrer information</a>
- <a href="http://b.agilob.net/better-security-privacy-and-anonymity-in-firefox/">Better security, privacy and anonymity in Firefox</a></p>
<h3 id="firefox-http-referer-options">Firefox HTTP Referer options</h3>
<p>HTTP settings are available by browsing <code>about:config</code>, here are the available settings and their values.</p>
<p><code>network.http.sendRefererHeader</code> - determines when to send the Referer HTTP header
- 0: Never send the referring URL
- not recommended, may break some sites
- 1: Send only on clicked links
- 2 (default): Send for links and images</p>
<p><code>network.http.referer.XOriginPolicy</code> - Cross-domain origin policy
- 0 (default): Always send
- 1: Send if base domains match
- 2: Send if hosts match</p>
<p><code>network.http.referer.spoofSource</code> - Referer spoofing (~faking)
- false (default): real referer
- true: spoof referer (use target URI as referer)
- known to break some functionality in Shaarli</p>
<p><code>network.http.referer.trimmingPolicy</code> - trim the URI not to send a full Referer
- 0 (default): send full URI
- 1: scheme+host+port+path
- 2: scheme+host+port</p>
<h3 id="firefox-localhost-and-redirections">Firefox, localhost and redirections</h3>
<p><code>localhost</code> is not a proper Fully Qualified Domain Name (FQDN); if Firefox has been set up to spoof referers, or only accept requests from the same base domain/host, Shaarli redirections will not work properly.</p>
<p>To solve this, assign a local domain to your host, e.g.</p>
<pre><code>127.0.0.1 localhost desktop localhost.lan
::1 localhost desktop localhost.lan
</code></pre>
<p>and browse Shaarli at http://localhost.lan/.</p>
<p>Related threads:
- <a href="https://bbs.archlinux.org/viewtopic.php?id=156064">What is localhost.localdomain for?</a>
- <a href="https://github.com/shaarli/Shaarli/issues/311">Stop returning to the first page after editing a bookmark from another page</a></p>
<h2 id="login">Login</h2>
<h3 id="i-forgot-my-password">I forgot my password!</h3>
<p>Delete the file <code>data/config.php</code> and display the page again. You will be asked for a new login/password.</p>
<h3 id="im-locked-out-login-bruteforce-protection">I'm locked out - Login bruteforce protection</h3>
<p>Login form is protected against brute force attacks: 4 failed logins will ban the IP address from login for 30 minutes. Banned IPs can still browse links.</p>
<p>To remove the current IP bans, delete the file <code>data/ipbans.php</code></p>
<h3 id="list-of-all-login-attempts">List of all login attempts</h3>
<p>The file <code>data/log.txt</code> shows all logins (successful or failed) and bans/lifted bans.
Search for <code>failed</code> in this file to look for unauthorized login attempts.</p>
<h2 id="hosting-problems">Hosting problems</h2>
<h3 id="old-php-versions">Old PHP versions</h3>
<ul>
<li>On <strong>free.fr</strong> : free.fr now support php 5.6.x(<a href="http://les.pages.perso.chez.free.fr/migrations/php5v6.io">link</a>)and so support now the tag autocompletion but you have to do the following : At the root of your webspace create a <code>sessions</code> directory and a <code>.htaccess</code> file containing:</li>
</ul>
<pre><code class="ini">&lt;IfDefine Free&gt;
php56 1
&lt;/IfDefine&gt;
</code></pre>
<ul>
<li>If you have an error such as: <code>Parse error: syntax error, unexpected '=', expecting '(' in /links/index.php on line xxx</code>, it means that your host is using php4, not php5. Shaarli requires php 5.1. Try changing the file extension to <code>.php5</code></li>
<li>On <strong>1and1</strong> : If you add the link from the page (and not from the bookmarklet), Shaarli will no be able to get the title of the page. You will have to enter it manually. (Because they have disabled the ability to download a file through HTTP).</li>
<li>If you have the error <code>Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /…/index.php on line xxx</code>, it means that your host has disabled the ability to fetch a file by HTTP in the php config (Typically in 1and1 hosting). Bad host. Change host. Or comment the following lines:</li>
</ul>
<pre><code class="php">//list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive.
// FIXME: Decode charset according to charset specified in either 1) HTTP response headers or 2) &lt;head&gt; in html
//if (strpos($status,'200 OK')) $title=html_extract_title($data);
</code></pre>
<ul>
<li>On hosts which forbid outgoing HTTP requests (such as free.fr), some thumbnails will not work.</li>
<li>On <strong>lost-oasis</strong>, RSS doesn't work correctly, because of this message at the begining of the RSS/ATOM feed : <code>&lt;? // tout ce qui est charge ici (generalement des includes et require) est charge en permanence. ?&gt;</code>. To fix this, remove this message from <code>php-include/prepend.php</code></li>
</ul>
<h3 id="dates-are-not-properly-formatted">Dates are not properly formatted</h3>
<p>Shaarli tries to sniff the language of the browser (using HTTP_ACCEPT_LANGUAGE headers) and choose a date format accordingly. But Shaarli can only use the date formats (and more generaly speaking, the locales) provided by the webserver. So even if you have a browser in French, you may end up with dates in US format (it's the case on sebsauvage.net :-( )</p>
<h3 id="problems-on-centos-servers">Problems on CentOS servers</h3>
<p>On <strong>CentOS</strong>/RedHat derivatives, you may need to install the <code>php-mbstring</code> package.</p>
<h3 id="my-session-expires-i-cant-stay-logged-in">My session expires! I can't stay logged in</h3>
<p>This can be caused by several things:</p>
<ul>
<li>Your php installation may not have a proper directory setup for session files. (eg. on Free.fr you need to create a <code>session</code> directory on the root of your website.) You may need to create the session directory of set it up.</li>
<li>Most hosts regularly clean the temporary and session directories. Your host may be cleaning those directories too aggressively (eg.OVH hosts), forcing an expire of the session. You may want to set the session directory in your web root. (eg. Create the <code>sessions</code> subdirectory and add <code>ini_set('session.save_path', $_SERVER['DOCUMENT_ROOT'].'/../sessions');</code>. Make sure this directory is not browsable !)</li>
<li>If your IP address changes during surfing, Shaarli will force expire your session for security reasons (to prevent session cookie hijacking). This can happen when surfing from WiFi or 3G (you may have switched WiFi/3G access point), or in some corporate/university proxies which use load balancing (and may have proxies with several external IP addresses).</li>
<li>Some browser addons may interfer with HTTP headers (ipfuck/ipflood/GreaseMonkey…). Try disabling those.</li>
<li>You may be using OperaTurbo or OperaMini, which use their own proxies which may change from time to time.</li>
<li>If you have another application on the same webserver where Shaarli is installed, these application may forcefully expire php sessions.</li>
</ul>
<h2 id="sessions-do-not-seem-to-work-correctly-on-your-server">Sessions do not seem to work correctly on your server</h2>
<p>Follow the instructions in the error message. Make sure you are accessing shaarli via a direct IP address or a proper hostname. If you have <strong>no dots</strong> in the hostname (e.g. <code>localhost</code> or <code>http://my-webserver/shaarli/</code>), some browsers will not store cookies at all (this respects the <a href="http://curl.haxx.se/rfc/cookie_spec.html">HTTP cookie specification</a>).</p>
<h3 id="pubsubhubbub-support">pubsubhubbub support</h3>
<p>Download <a href="https://pubsubhubbub.googlecode.com/git/publisher_clients/php/library/publisher.php">publisher.php</a> at the root of your Shaarli installation and set <code>$GLOBALS['config']['PUBSUBHUB_URL']</code> in your <code>config.php</code></p>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../Development-guidelines/" class="btn btn-neutral float-right" title="Development guidelines">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="../Various-hacks/" class="btn btn-neutral" title="Various hacks"><span class="icon icon-circle-arrow-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
</div>
Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" style="cursor: pointer">
<span class="rst-current-version" data-toggle="rst-current-version">
<a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
<span><a href="../Various-hacks/" style="color: #fcfcfc;">&laquo; Previous</a></span>
<span style="margin-left: 15px"><a href="../Development-guidelines/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script src="../js/theme.js"></script>
</body>
</html>