parent
52599c5eec
commit
f5a2397498
@ -0,0 +1,130 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en" dir="ltr"> |
||||
<head> |
||||
<meta charset="utf-8" /> |
||||
<title>documentation:2.0:highperfnginxhandler</title> |
||||
<meta name="generator" content="DokuWiki"/> |
||||
<meta name="robots" content="noindex,nofollow"/> |
||||
<meta name="keywords" content="documentation,2.0,highperfnginxhandler"/> |
||||
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/> |
||||
<link rel="start" href="highperfnginxhandler.html"/> |
||||
<link rel="contents" href="highperfnginxhandler.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:highperfnginxhandler","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"> |
||||
|
||||
<h1 class="sectionedit1" id="high_performance_handler_for_nginx">High performance handler for Nginx</h1> |
||||
<div class="level1"> |
||||
|
||||
<p> |
||||
By default, LLNG-FastCGI-Server provides a FastCGI server that handles all LLNG services using a FastCGI socket. |
||||
</p> |
||||
|
||||
<p> |
||||
To increase handler performances, It can be replaced by any Plack family server using for examle this simple app: |
||||
</p> |
||||
<dl class="file"> |
||||
<dt><a href="_export/code/documentation/2.0/highperfnginxhandler/codeblock.0.code" title="Download Snippet" class="mediafile mf_psgi">app.psgi</a></dt> |
||||
<dd><pre class="code file perl"><a href="http://perldoc.perl.org/functions/require.html"><span class="kw3">require</span></a> Lemonldap<span class="sy0">::</span><span class="me2">NG</span><span class="sy0">::</span><span class="me2">Handler</span><span class="sy0">::</span><span class="me2">Server</span><span class="sy0">::</span><span class="me2">Nginx</span><span class="sy0">;</span> |
||||
Lemonldap<span class="sy0">::</span><span class="me2">NG</span><span class="sy0">::</span><span class="me2">Handler</span><span class="sy0">::</span><span class="me2">Server</span><span class="sy0">::</span><span class="me2">Nginx</span><span class="sy0">-></span><span class="me1">run</span><span class="br0">(</span> <span class="br0">{</span><span class="br0">}</span> <span class="br0">)</span><span class="sy0">;</span></pre> |
||||
</dd></dl> |
||||
|
||||
<p> |
||||
Example to launch it: |
||||
</p> |
||||
<ul> |
||||
<li class="level1"><div class="li"> <a href="http://uwsgi-docs.readthedocs.io/en/latest/Perl.html" class="urlextern" title="http://uwsgi-docs.readthedocs.io/en/latest/Perl.html" rel="nofollow">uWSGI</a> <em>(probably the fastest)</em>: <strong>see below</strong></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/distribution/Starman/script/starman" class="urlextern" title="https://metacpan.org/pod/distribution/Starman/script/starman" rel="nofollow">Starman</a> <em>(“Prefork” server)</em>: <code>plackup -s Starman –listen 127.0.0.1:9090 app.psgi</code></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/twiggy" class="urlextern" title="https://metacpan.org/pod/twiggy" rel="nofollow">Twiggy</a> <em>(“Event” server)</em>: <code>plackup -s Twiggy –listen 127.0.0.1:9090 app.psgi</code></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/Twiggy::Prefork" class="urlextern" title="https://metacpan.org/pod/Twiggy::Prefork" rel="nofollow">Twiggy::Prefork</a> <em>(“Event+Prefork” server)</em>: <code>plackup -s Twiggy::Prefork –listen 127.0.0.1:9090 app.psgi</code></div> |
||||
</li> |
||||
</ul> |
||||
|
||||
<p> |
||||
You must so remplace <code>lmauth</code> configuration in Nginx configuration file: |
||||
</p> |
||||
<pre class="code file nginx"> location = /lmauth { |
||||
internal; |
||||
proxy_pass http://127.0.0.1:9090/; |
||||
|
||||
# Drop post datas |
||||
proxy_pass_request_body off; |
||||
proxy_set_header Content-Length ""; |
||||
|
||||
# Keep original hostname |
||||
proxy_set_header Host $http_host; |
||||
|
||||
# Keep original request (LLNG server will received /llauth) |
||||
proxy_set_header X-Original_Uri $request_uri; |
||||
} |
||||
...</pre> |
||||
|
||||
</div> |
||||
<!-- EDIT1 SECTION "High performance handler for Nginx" [1-1440] --> |
||||
<h2 class="sectionedit2" id="using_uwsgi">Using uWSGI</h2> |
||||
<div class="level2"> |
||||
|
||||
<p> |
||||
This configuration requires uWSGI, uWSGI PSGI plugin and Nginx uwsgi module. |
||||
</p> |
||||
<pre class="code bash"><span class="co4">$ </span>uwsgi <span class="re5">--plugins</span> psgi <span class="re5">--socket</span> :<span class="nu0">5000</span> <span class="re5">--psgi</span> llng-server.psgi</pre> |
||||
|
||||
<p> |
||||
Nginx configuration: |
||||
</p> |
||||
<pre class="code file nginx">upstream uwsgi-test { |
||||
server 127.0.0.1:5000; |
||||
} |
||||
|
||||
server { |
||||
location = /lmauth { |
||||
internal; |
||||
include uwsgi_params; |
||||
uwsgi_pass_request_body off; |
||||
uwsgi_param CONTENT_LENGTH ""; |
||||
uwsgi_param HOST $http_host; |
||||
uwsgi_param X_ORIGINAL_URI $request_uri; |
||||
uwsgi_modifier1 5; |
||||
uwsgi_pass uwsgi-test; |
||||
} |
||||
... |
||||
}</pre> |
||||
|
||||
</div> |
||||
<!-- EDIT2 SECTION "Using uWSGI" [1441-] --></div> |
||||
</body> |
||||
</html> |
@ -0,0 +1,80 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en" dir="ltr"> |
||||
<head> |
||||
<meta charset="utf-8" /> |
||||
<title>documentation:2.0:managertests</title> |
||||
<meta name="generator" content="DokuWiki"/> |
||||
<meta name="robots" content="noindex,nofollow"/> |
||||
<meta name="keywords" content="documentation,2.0,managertests"/> |
||||
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/> |
||||
<link rel="start" href="managertests.html"/> |
||||
<link rel="contents" href="managertests.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:managertests","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"> |
||||
|
||||
<h1 class="sectionedit1" id="ignore_some_manager_tests">Ignore some manager tests</h1> |
||||
<div class="level1"> |
||||
|
||||
<p> |
||||
Each time you save a configuration, Manager launch a lot of tests: |
||||
</p> |
||||
<ul> |
||||
<li class="level1"><div class="li"> unit tests for each key: they are declared in Lemonldap::NG::Manager::Attributes <em>(source Lemonldap::NG::Manager::Build::Attributes)</em></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> more advanced tests declared in Lemonldap::NG::Manager::Conf::Tests</div> |
||||
</li> |
||||
</ul> |
||||
|
||||
<p> |
||||
In some case <em>(conf overridden in INI file,…)</em>, you may have to ignore some of them. You just have to list them <em>(space separated)</em> in a special key in <code>lemonldap-ng.ini</code>, section <code>[Manager]</code>: |
||||
</p> |
||||
<ul> |
||||
<li class="level1"><div class="li"> <code>skippedUnitTests</code> for unit tests</div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <code>skippedGlobalTests</code> for global tests</div> |
||||
</li> |
||||
</ul> |
||||
|
||||
<p> |
||||
Example: |
||||
</p> |
||||
<pre class="code file ini"><span class="re0"><span class="br0">[</span>Manager<span class="br0">]</span></span> |
||||
<span class="re1">skippedUnitTests</span> <span class="sy0">=</span><span class="re2"> grantSessionRules portalSkinRules</span> |
||||
<span class="re1">skippedGlobalTests</span> <span class="sy0">=</span><span class="re2"> testApacheSession</span></pre> |
||||
|
||||
</div> |
||||
</div> |
||||
</body> |
||||
</html> |
@ -0,0 +1,117 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en" dir="ltr"> |
||||
<head> |
||||
<meta charset="utf-8" /> |
||||
<title>documentation:2.0:psgi</title> |
||||
<meta name="generator" content="DokuWiki"/> |
||||
<meta name="robots" content="noindex,nofollow"/> |
||||
<meta name="keywords" content="documentation,2.0,psgi"/> |
||||
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/> |
||||
<link rel="start" href="psgi.html"/> |
||||
<link rel="contents" href="psgi.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:psgi","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"> |
||||
|
||||
<h1 class="sectionedit1" id="advanced_psgi_usage">Advanced PSGI usage</h1> |
||||
<div class="level1"> |
||||
|
||||
<p> |
||||
LLNG is build on <a href="http://plackperl.org/" class="urlextern" title="http://plackperl.org/" rel="nofollow">Plack</a>, so it can be used with any compatible server: |
||||
</p> |
||||
<ul> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/starman" class="urlextern" title="https://metacpan.org/pod/starman" rel="nofollow">Starman</a></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/twiggy" class="urlextern" title="https://metacpan.org/pod/twiggy" rel="nofollow">Twiggy</a></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/Twiggy::Prefork" class="urlextern" title="https://metacpan.org/pod/Twiggy::Prefork" rel="nofollow">Twiggy::Prefork</a></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/feersum" class="urlextern" title="https://metacpan.org/pod/feersum" rel="nofollow">Starman</a></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> uWSGI using <a href="http://uwsgi-docs.readthedocs.io/en/latest/Perl.html" class="urlextern" title="http://uwsgi-docs.readthedocs.io/en/latest/Perl.html" rel="nofollow">uWSGI PSGI plugin</a></div> |
||||
</li> |
||||
</ul> |
||||
|
||||
<p> |
||||
uWSGI may provide the highest performance. |
||||
</p> |
||||
|
||||
</div> |
||||
<!-- EDIT1 SECTION "Advanced PSGI usage" [1-477] --> |
||||
<h2 class="sectionedit2" id="fastcgi_server_replacement">FastCGI server replacement</h2> |
||||
<div class="level2"> |
||||
|
||||
<p> |
||||
A <code>llng-server.psgi</code> is provided in example directory. It is designed to replace exactly FastCGI server. You can use it : |
||||
</p> |
||||
<ul> |
||||
<li class="level1"><div class="li"> with a FCGI Plack server, but you just have to change llng-fastcgi-server engine <em>(in /etc/default/llng-fastcgi-server)</em> to have the same result</div> |
||||
</li> |
||||
<li class="level1"><div class="li"> with a HTTP Plack server, not yet tested</div> |
||||
</li> |
||||
<li class="level1"><div class="li"> with uWSGI <em><strong>(see below)</strong></em></div> |
||||
</li> |
||||
</ul> |
||||
<div class="noteimportant">Starman, Twiggy,… are HTTP servers, not FCGI ones ! |
||||
</div> |
||||
<p> |
||||
You can also replace only a part of it to create a specialized FastCGI server (portal,…). Look at <code>llng-server.psgi</code> example and take the part you want to use. |
||||
</p> |
||||
|
||||
<p> |
||||
There are also some other psgi files in examples directory. |
||||
</p> |
||||
|
||||
<p> |
||||
See also <a href="highperfnginxhandler.html" class="wikilink1" title="documentation:2.0:highperfnginxhandler">High performance handler for Nginx</a> |
||||
</p> |
||||
|
||||
</div> |
||||
<!-- EDIT2 SECTION "FastCGI server replacement" [478-1265] --> |
||||
<h3 class="sectionedit3" id="using_uwsgi">Using uWSGI</h3> |
||||
<div class="level3"> |
||||
|
||||
<p> |
||||
You must install uWSGI PSGI plugin. Then for example, launch llng-server.psgi <em>(simple example)</em>: |
||||
</p> |
||||
<pre class="code">uwsgi --plugins psgi --socket :5000 --psgi e2e-tests/llng-server.psgi</pre> |
||||
|
||||
<p> |
||||
You will find in LLNG Nginx configuration files some comments that explain how to configure Nginx to use uWSGI instead of LLNG FastCGI server. |
||||
</p> |
||||
|
||||
</div> |
||||
<!-- EDIT3 SECTION "Using uWSGI" [1266-] --></div> |
||||
</body> |
||||
</html> |
@ -0,0 +1,143 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="fr" dir="ltr"> |
||||
<head> |
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
||||
<meta charset="utf-8" /> |
||||
<title>documentation:2.0:highperfnginxhandler</title><!-- //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 --><!-- //endif --> |
||||
<meta name="generator" content="DokuWiki"/> |
||||
<meta name="robots" content="noindex,nofollow"/> |
||||
<meta name="keywords" content="documentation,2.0,highperfnginxhandler"/> |
||||
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/> |
||||
<link rel="start" href="highperfnginxhandler.html"/> |
||||
<link rel="contents" href="highperfnginxhandler.html" title="Sitemap"/> |
||||
<link rel="stylesheet" type="text/css" href="lib/exe/css.php.t.bootstrap3.css"/> |
||||
|
||||
<link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.css" /> |
||||
|
||||
<script type="text/javascript">/*<![CDATA[*/var NS='documentation:2.0';var JSINFO = {"id":"documentation:2.0:highperfnginxhandler","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"> |
||||
|
||||
<h1 class="sectionedit1" id="high_performance_handler_for_nginx">High performance handler for Nginx</h1> |
||||
<div class="level1"> |
||||
|
||||
<p> |
||||
|
||||
By default, LLNG-FastCGI-Server provides a FastCGI server that handles all LLNG services using a FastCGI socket. |
||||
|
||||
</p> |
||||
|
||||
<p> |
||||
|
||||
To increase handler performances, It can be replaced by any Plack family server using for examle this simple app: |
||||
|
||||
</p> |
||||
<dl class="file"> |
||||
<dt><a href="_export/code/documentation/2.0/highperfnginxhandler/codeblock.0.code" title="Download Snippet" class="mediafile mf_psgi">app.psgi</a></dt> |
||||
<dd><pre class="code file perl"><a href="http://perldoc.perl.org/functions/require.html"><span class="kw3">require</span></a> Lemonldap<span class="sy0">::</span><span class="me2">NG</span><span class="sy0">::</span><span class="me2">Handler</span><span class="sy0">::</span><span class="me2">Server</span><span class="sy0">::</span><span class="me2">Nginx</span><span class="sy0">;</span> |
||||
Lemonldap<span class="sy0">::</span><span class="me2">NG</span><span class="sy0">::</span><span class="me2">Handler</span><span class="sy0">::</span><span class="me2">Server</span><span class="sy0">::</span><span class="me2">Nginx</span><span class="sy0">-></span><span class="me1">run</span><span class="br0">(</span> <span class="br0">{</span><span class="br0">}</span> <span class="br0">)</span><span class="sy0">;</span></pre> |
||||
</dd></dl> |
||||
|
||||
<p> |
||||
|
||||
Example to launch it: |
||||
|
||||
</p> |
||||
<ul> |
||||
<li class="level1"><div class="li"> <a href="http://uwsgi-docs.readthedocs.io/en/latest/Perl.html" class="urlextern" title="http://uwsgi-docs.readthedocs.io/en/latest/Perl.html" rel="nofollow">uWSGI</a> <em>(probably the fastest)</em>: <strong>see below</strong></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/distribution/Starman/script/starman" class="urlextern" title="https://metacpan.org/pod/distribution/Starman/script/starman" rel="nofollow">Starman</a> <em>(“Prefork” server)</em>: <code>plackup -s Starman –listen 127.0.0.1:9090 app.psgi</code></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/twiggy" class="urlextern" title="https://metacpan.org/pod/twiggy" rel="nofollow">Twiggy</a> <em>(“Event” server)</em>: <code>plackup -s Twiggy –listen 127.0.0.1:9090 app.psgi</code></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/Twiggy::Prefork" class="urlextern" title="https://metacpan.org/pod/Twiggy::Prefork" rel="nofollow">Twiggy::Prefork</a> <em>(“Event+Prefork” server)</em>: <code>plackup -s Twiggy::Prefork –listen 127.0.0.1:9090 app.psgi</code></div> |
||||
</li> |
||||
</ul> |
||||
|
||||
<p> |
||||
|
||||
You must so remplace <code>lmauth</code> configuration in Nginx configuration file: |
||||
|
||||
</p> |
||||
<pre class="code file nginx"> location = /lmauth { |
||||
internal; |
||||
proxy_pass http://127.0.0.1:9090/; |
||||
|
||||
# Ignorer les données postées |
||||
proxy_pass_request_body off; |
||||
proxy_set_header Content-Length ""; |
||||
|
||||
# Conserver le nom d'hôte original |
||||
proxy_set_header Host $http_host; |
||||
|
||||
# Conserver la requête originale (le serveur LLNG va recevoir /llauth) |
||||
proxy_set_header X-Original_Uri $request_uri; |
||||
} |
||||
...</pre> |
||||
|
||||
</div><!-- EDIT1 SECTION "High performance handler for Nginx" [1-1440] --> |
||||
|
||||
<h2 class="sectionedit2" id="using_uwsgi">Using uWSGI</h2> |
||||
<div class="level2"> |
||||
|
||||
<p> |
||||
|
||||
This configuration requires uWSGI, uWSGI PSGI plugin and Nginx uwsgi module. |
||||
|
||||
</p> |
||||
<pre class="code bash"><span class="co4">$ </span>uwsgi <span class="re5">--plugins</span> psgi <span class="re5">--socket</span> :<span class="nu0">5000</span> <span class="re5">--psgi</span> llng-server.psgi</pre> |
||||
|
||||
<p> |
||||
|
||||
Nginx configuration: |
||||
|
||||
</p> |
||||
<pre class="code file nginx">upstream uwsgi-test { |
||||
server 127.0.0.1:5000; |
||||
} |
||||
|
||||
server { |
||||
location = /lmauth { |
||||
internal; |
||||
include uwsgi_params; |
||||
uwsgi_pass_request_body off; |
||||
uwsgi_param CONTENT_LENGTH ""; |
||||
uwsgi_param HOST $http_host; |
||||
uwsgi_param X_ORIGINAL_URI $request_uri; |
||||
uwsgi_modifier1 5; |
||||
uwsgi_pass uwsgi-test; |
||||
} |
||||
... |
||||
}</pre> |
||||
|
||||
</div><!-- EDIT2 SECTION "Using uWSGI" [1441-] --> |
||||
</div> |
||||
</body> |
||||
</html> |
@ -0,0 +1,85 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="fr" dir="ltr"> |
||||
<head> |
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
||||
<meta charset="utf-8" /> |
||||
<title>documentation:2.0:managertests</title><!-- //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 --><!-- //endif --> |
||||
<meta name="generator" content="DokuWiki"/> |
||||
<meta name="robots" content="noindex,nofollow"/> |
||||
<meta name="keywords" content="documentation,2.0,managertests"/> |
||||
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/> |
||||
<link rel="start" href="managertests.html"/> |
||||
<link rel="contents" href="managertests.html" title="Sitemap"/> |
||||
<link rel="stylesheet" type="text/css" href="lib/exe/css.php.t.bootstrap3.css"/> |
||||
|
||||
<link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.css" /> |
||||
|
||||
<script type="text/javascript">/*<![CDATA[*/var NS='documentation:2.0';var JSINFO = {"id":"documentation:2.0:managertests","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"> |
||||
|
||||
<h1 class="sectionedit1" id="ignore_some_manager_tests">Ignore some manager tests</h1> |
||||
<div class="level1"> |
||||
|
||||
<p> |
||||
|
||||
Each time you save a configuration, Manager launch a lot of tests: |
||||
|
||||
</p> |
||||
<ul> |
||||
<li class="level1"><div class="li"> unit tests for each key: they are declared in Lemonldap::NG::Manager::Attributes <em>(source Lemonldap::NG::Manager::Build::Attributes)</em></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> more advanced tests declared in Lemonldap::NG::Manager::Conf::Tests</div> |
||||
</li> |
||||
</ul> |
||||
|
||||
<p> |
||||
|
||||
In some case <em>(conf overridden in INI file,…)</em>, you may have to ignore some of them. You just have to list them <em>(space separated)</em> in a special key in <code>lemonldap-ng.ini</code>, section <code>[Manager]</code>: |
||||
|
||||
</p> |
||||
<ul> |
||||
<li class="level1"><div class="li"> <code>skippedUnitTests</code> for unit tests</div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <code>skippedGlobalTests</code> for global tests</div> |
||||
</li> |
||||
</ul> |
||||
|
||||
<p> |
||||
Exemple : |
||||
</p> |
||||
<pre class="code file ini"><span class="re0"><span class="br0">[</span>Manager<span class="br0">]</span></span> |
||||
<span class="re1">skippedUnitTests</span> <span class="sy0">=</span><span class="re2"> grantSessionRules portalSkinRules</span> |
||||
<span class="re1">skippedGlobalTests</span> <span class="sy0">=</span><span class="re2"> testApacheSession</span></pre> |
||||
|
||||
</div> |
||||
</div> |
||||
</body> |
||||
</html> |
@ -0,0 +1,134 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="fr" dir="ltr"> |
||||
<head> |
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
||||
<meta charset="utf-8" /> |
||||
<title>documentation:2.0:psgi</title><!-- //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 --><!-- //endif --> |
||||
<meta name="generator" content="DokuWiki"/> |
||||
<meta name="robots" content="noindex,nofollow"/> |
||||
<meta name="keywords" content="documentation,2.0,psgi"/> |
||||
<link rel="search" type="application/opensearchdescription+xml" href="lib/exe/opensearch.html" title="LemonLDAP::NG"/> |
||||
<link rel="start" href="psgi.html"/> |
||||
<link rel="contents" href="psgi.html" title="Sitemap"/> |
||||
<link rel="stylesheet" type="text/css" href="lib/exe/css.php.t.bootstrap3.css"/> |
||||
|
||||
<link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.css" /> |
||||
|
||||
<script type="text/javascript">/*<![CDATA[*/var NS='documentation:2.0';var JSINFO = {"id":"documentation:2.0:psgi","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"> |
||||
|
||||
<h1 class="sectionedit1" id="advanced_psgi_usage">Advanced PSGI usage</h1> |
||||
<div class="level1"> |
||||
|
||||
<p> |
||||
|
||||
LLNG is build on <a href="http://plackperl.org/" class="urlextern" title="http://plackperl.org/" rel="nofollow">Plack</a>, so it can be used with any compatible server: |
||||
|
||||
</p> |
||||
<ul> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/starman" class="urlextern" title="https://metacpan.org/pod/starman" rel="nofollow">Starman</a></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/twiggy" class="urlextern" title="https://metacpan.org/pod/twiggy" rel="nofollow">Twiggy</a></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/Twiggy::Prefork" class="urlextern" title="https://metacpan.org/pod/Twiggy::Prefork" rel="nofollow">Twiggy::Prefork</a></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> <a href="https://metacpan.org/pod/feersum" class="urlextern" title="https://metacpan.org/pod/feersum" rel="nofollow">Starman</a></div> |
||||
</li> |
||||
<li class="level1"><div class="li"> uWSGI using <a href="http://uwsgi-docs.readthedocs.io/en/latest/Perl.html" class="urlextern" title="http://uwsgi-docs.readthedocs.io/en/latest/Perl.html" rel="nofollow">uWSGI PSGI plugin</a></div> |
||||
</li> |
||||
</ul> |
||||
|
||||
<p> |
||||
|
||||
uWSGI may provide the highest performance. |
||||
|
||||
</p> |
||||
|
||||
</div><!-- EDIT1 SECTION "Advanced PSGI usage" [1-477] --> |
||||
|
||||
<h2 class="sectionedit2" id="fastcgi_server_replacement">FastCGI server replacement</h2> |
||||
<div class="level2"> |
||||
|
||||
<p> |
||||
|
||||
A <code>llng-server.psgi</code> is provided in example directory. It is designed to replace exactly FastCGI server. You can use it : |
||||
|
||||
</p> |
||||
<ul> |
||||
<li class="level1"><div class="li"> with a FCGI Plack server, but you just have to change llng-fastcgi-server engine <em>(in /etc/default/llng-fastcgi-server)</em> to have the same result</div> |
||||
</li> |
||||
<li class="level1"><div class="li"> with a HTTP Plack server, not yet tested</div> |
||||
</li> |
||||
<li class="level1"><div class="li"> with uWSGI <em><strong>(see below)</strong></em></div> |
||||
</li> |
||||
</ul> |
||||
<div class="noteimportant">Starman, Twiggy,… are HTTP servers, not FCGI ones ! |
||||
|
||||
</div> |
||||
<p> |
||||
|
||||
You can also replace only a part of it to create a specialized FastCGI server (portal,…). Look at <code>llng-server.psgi</code> example and take the part you want to use. |
||||
|
||||
</p> |
||||
|
||||
<p> |
||||
|
||||
There are also some other psgi files in examples directory. |
||||
|
||||
</p> |
||||
|
||||
<p> |
||||
|
||||
See also <a href="highperfnginxhandler.html" class="wikilink1" title="documentation:2.0:highperfnginxhandler">High performance handler for Nginx</a> |
||||
</p> |
||||
|
||||
</div><!-- EDIT2 SECTION "FastCGI server replacement" [478-1265] --> |
||||
|
||||
<h3 class="sectionedit3" id="using_uwsgi">Using uWSGI</h3> |
||||
<div class="level3"> |
||||
|
||||
<p> |
||||
|
||||
You must install uWSGI PSGI plugin. Then for example, launch llng-server.psgi <em>(simple example)</em>: |
||||
|
||||
</p> |
||||
<pre class="code">uwsgi --plugins psgi --socket :5000 --psgi e2e-tests/llng-server.psgi</pre> |
||||
|
||||
<p> |
||||
|
||||
You will find in LLNG Nginx configuration files some comments that explain how to configure Nginx to use uWSGI instead of LLNG FastCGI server. |
||||
|
||||
</p> |
||||
|
||||
</div><!-- EDIT3 SECTION "Using uWSGI" [1266-] --> |
||||
</div> |
||||
</body> |
||||
</html> |
Loading…
Reference in new issue