lemonldap-ng/doc/pages/documentation/current/status.html
2019-02-12 17:32:02 +01:00

233 lines
9.6 KiB
HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<title>documentation:2.0:status</title>
<meta name="generator" content="DokuWiki"/>
<meta name="robots" content="index,follow"/>
<meta name="keywords" content="documentation,2.0,status"/>
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/>
<link rel="start" href="status.html"/>
<link rel="contents" href="status.html" title="Sitemap"/>
<link rel="stylesheet" type="text/css" href="lib/exe/css.php.t.bootstrap3.css"/>
<!-- //if:usedebianlibs
<link rel="stylesheet" type="text/css" href="/javascript/bootstrap/css/bootstrap.min.css" />
//elsif:useexternallibs
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></script>
//elsif:cssminified
<link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.min.css" />
//else -->
<link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.css" />
<!-- //endif -->
<script type="text/javascript">/*<![CDATA[*/var NS='documentation:2.0';var JSINFO = {"id":"documentation:2.0:status","namespace":"documentation:2.0"};
/*!]]>*/</script>
<script type="text/javascript" charset="utf-8" src="lib/exe/js.php.t.bootstrap3.js"></script>
<!-- //if:usedebianlibs
<script type="text/javascript" src="/javascript/jquery/jquery.min.js"></script>
//elsif:useexternallibs
<script type="text/javascript" src="http://code.jquery.com/jquery-2.2.0.min.js"></script>
//elsif:jsminified
<script type="text/javascript" src="/static/bwr/jquery/dist/jquery.min.js"></script>
//else -->
<script type="text/javascript" src="/static/bwr/jquery/dist/jquery.js"></script>
<!-- //endif -->
<!-- //if:usedebianlibs
<script type="text/javascript" src="/javascript/jquery-ui/jquery-ui.min.js"></script>
//elsif:useexternallibs
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
//elsif:jsminified
<script type="text/javascript" src="/static/bwr/jquery-ui/jquery-ui.min.js"></script>
//else -->
<script type="text/javascript" src="/static/bwr/jquery-ui/jquery-ui.js"></script>
<!-- //endif -->
</head>
<body>
<div class="dokuwiki export container">
<!-- TOC START -->
<div id="dw__toc">
<h3 class="toggle">Table of Contents</h3>
<div>
<ul class="toc">
<li class="level1"><div class="li"><a href="#portal_status_experimental">Portal Status (experimental)</a></div>
<ul class="toc">
<li class="level2"><div class="li"><a href="#configuration">Configuration</a></div></li>
</ul>
</li>
<li class="level1"><div class="li"><a href="#handler_status">Handler Status</a></div>
<ul class="toc">
<li class="level2"><div class="li"><a href="#presentation">Presentation</a></div></li>
<li class="level2"><div class="li"><a href="#configuration1">Configuration</a></div>
<ul class="toc">
<li class="level3"><div class="li"><a href="#nginx">Nginx</a></div></li>
<li class="level3"><div class="li"><a href="#apache">Apache</a></div></li>
<li class="level3"><div class="li"><a href="#lemonldapng">LemonLDAP::NG</a></div></li>
</ul>
</li>
<li class="level2"><div class="li"><a href="#advanced">Advanced</a></div></li>
</ul></li>
</ul>
</div>
</div>
<!-- TOC END -->
<h1 class="sectionedit1" id="status_pages">Status pages</h1>
<div class="level1">
</div>
<!-- EDIT1 SECTION "Status pages" [1-28] -->
<h2 class="sectionedit2" id="portal_status_experimental">Portal Status (experimental)</h2>
<div class="level2">
<p>
The portal displays in JSON format its activity. Some d This can give a view to all returned codes.
</p>
</div>
<!-- EDIT2 SECTION "Portal Status (experimental)" [29-171] -->
<h3 class="sectionedit3" id="configuration">Configuration</h3>
<div class="level3">
<p>
* Set <code>portalStatus = 1</code> in lemonldap-ng.ini file (section <code>[Portal]</code>)
* Note that handler status must also been enabled
* Protect <a href="http://portal/portalStatus" class="urlextern" title="http://portal/portalStatus" rel="nofollow">http://portal/portalStatus</a> using your webserver configuration
</p>
<p>
Status is displayed by calling this <abbr title="Uniform Resource Locator">URL</abbr>.
</p>
</div>
<!-- EDIT3 SECTION "Configuration" [172-439] -->
<h2 class="sectionedit4" id="handler_status">Handler Status</h2>
<div class="level2">
</div>
<!-- EDIT4 SECTION "Handler Status" [440-467] -->
<h3 class="sectionedit5" id="presentation">Presentation</h3>
<div class="level3">
<p>
When status feature is activated, Handlers and portal will collect statistics and save them in their local cache. This means that if several Handlers are deployed, each will manage its own statistics.
</p>
<div class="notetip">This page can be browsed for example by <a href="http://oss.oetiker.ch/mrtg/" class="urlextern" title="http://oss.oetiker.ch/mrtg/" rel="nofollow">MRTG</a> using the <a href="mrtg.html" class="wikilink1" title="documentation:2.0:mrtg">MRTG monitoring script</a>.
</div>
<p>
The statistics are collected trough a daemon launched by the Handler. It can be seen in system processes.
</p>
<p>
Statistics are displayed when calling the status path on an Handler (for example: <a href="http://reload.example.com/status" class="urlextern" title="http://reload.example.com/status" rel="nofollow">http://reload.example.com/status</a>).
</p>
<p>
Example of status page:
</p>
<p>
<a href="documentation/status_standard.png_documentation_2.0_status.html" class="media" title="documentation:status_standard.png"><img src="documentation/status_standard.png" class="mediacenter" alt="" /></a>
</p>
</div>
<!-- EDIT5 SECTION "Presentation" [468-1126] -->
<h3 class="sectionedit6" id="configuration1">Configuration</h3>
<div class="level3">
</div>
<h4 id="nginx">Nginx</h4>
<div class="level4">
<p>
You need to give access to status path in the Handler Nginx configuration:
</p>
<pre class="code file nginx">server {
listen __PORT__;
server_name reload.__DNSDOMAIN__;
root /var/www/html;
...
location = /status {
allow 127.0.0.1;
deny all;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:__FASTCGISOCKDIR__/llng-fastcgi.sock;
fastcgi_param LLTYPE status;
}
}</pre>
</div>
<h4 id="apache">Apache</h4>
<div class="level4">
<p>
You need to give access to status path in the Handler Apache configuration:
</p>
<pre class="code file apache"> <span class="co1"># Uncomment this to activate status module</span>
&lt;<span class="kw3">Location</span> /status&gt;
<span class="kw1">Order</span> <span class="kw1">deny</span>,<span class="kw1">allow</span>
<span class="kw1">Allow</span> from 127.0.0.0/<span class="nu0">8</span>
PerlHeaderParserHandler Lemonldap::NG::Handler-&gt;status
&lt;/<span class="kw3">Location</span>&gt;</pre>
<p>
Then restart Apache.
</p>
<div class="notetip">You should change the <code>Allow</code> directive to match administration <abbr title="Internet Protocol">IP</abbr>, or use another Apache protection mean.
</div>
</div>
<h5 id="portal_data">Portal data</h5>
<div class="level5">
<p>
By default Apache handler status process listen to <code>localhost:64321</code> <em>(UDP)</em>. You can change this using <code>LLNGSTATUSLISTEN</code> environment variable. If you want to collect portal data, you just have to set <code>LLNGSTATUSHOST</code> environment variable <em>(see comments in our <code>portal-apache2.conf</code>)</em>.
</p>
<pre class="code apache"> &lt;<span class="kw3">Files</span> *.fcgi&gt;
<span class="kw1">SetHandler</span> fcgid-<span class="kw1">script</span>
<span class="co1"># For Authorization header to be passed, please uncomment one of the following:</span>
<span class="co1"># for Apache &gt;= 2.4.13</span>
<span class="co1">#CGIPassAuth On</span>
<span class="co1"># for Apache &lt; 2.4.13</span>
<span class="co1">#RewriteCond %{HTTP:Authorization} ^(.*)</span>
<span class="co1">#RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]</span>
<span class="kw1">Options</span> +ExecCGI
<span class="kw1">header</span> unset Lm-Remote-<span class="kw1">User</span>
&lt;/<span class="kw3">Files</span>&gt;
FcgidInitialEnv LLNGSTATUSHOST 127.0.0.1:<span class="nu0">64321</span></pre>
</div>
<h4 id="lemonldapng">LemonLDAP::NG</h4>
<div class="level4">
<p>
Edit <code>lemonldap-ng.ini</code>, and activate status in the <code>handler</code> section:
</p>
<pre class="code file ini"><span class="re0"><span class="br0">&#91;</span>all<span class="br0">&#93;</span></span>
# Set status to <span class="nu0">1</span> if you want to have the report of activity <span class="br0">&#40;</span>used for
# example to inform MRTG<span class="br0">&#41;</span>
<span class="re1">status</span> <span class="sy0">=</span><span class="re2"> 1</span></pre>
<p>
Then restart webserver.
</p>
</div>
<!-- EDIT6 SECTION "Configuration" [1127-3029] -->
<h3 class="sectionedit7" id="advanced">Advanced</h3>
<div class="level3">
<ol>
<li class="level1"><div class="li"> You can also open the UDP port with Nginx if you set <code>LLNGSTATUSLISTEN</code> environment variable <em>(host:port)</em></div>
</li>
<li class="level1"><div class="li"> When querying status <em>(using portal or handler status)</em> and if UDP is used, query is given to <code>LLNGSTATUSHOST</code> <em>(host:port)</em> and response is waiting on a dynamic UDP port given in query <em>(between 64322 and 64331)</em>. By default this dynamic UDP port is opened on loopback <em>(<code>localhost</code> entry in <code>/etc/hosts</code>)</em>. To change this, set an <abbr title="Internet Protocol">IP</abbr> address or a host using <code>LLNGSTATUSCLIENT</code> environment variable.</div>
</li>
</ol>
</div>
<!-- EDIT7 SECTION "Advanced" [3030-] --></div>
</body>
</html>