2016-10-15 19:57:04 +02:00
<!DOCTYPE html>
< html lang = "en" dir = "ltr" >
< head >
< meta charset = "utf-8" / >
< title > documentation:2.0:mongodbconfbackend< / title >
< meta name = "generator" content = "DokuWiki" / >
2017-02-22 13:41:23 +01:00
< meta name = "robots" content = "index,follow" / >
2016-10-15 19:57:04 +02:00
< meta name = "keywords" content = "documentation,2.0,mongodbconfbackend" / >
< link rel = "search" type = "application/opensearchdescription+xml" href = "lib/exe/opensearch.html" title = "LemonLDAP::NG" / >
< link rel = "start" href = "mongodbconfbackend.html" / >
< link rel = "contents" href = "mongodbconfbackend.html" title = "Sitemap" / >
< link rel = "stylesheet" type = "text/css" href = "lib/exe/css.php.t.bootstrap3.css" / >
2017-02-07 17:35:26 +01:00
<!-- //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 -->
2016-10-15 19:57:04 +02:00
< script type = "text/javascript" > / * < ! [ C D A T A [ * / v a r N S = ' d o c u m e n t a t i o n : 2 . 0 ' ; v a r J S I N F O = { " i d " : " d o c u m e n t a t i o n : 2 . 0 : m o n g o d b c o n f b a c k e n d " , " n a m e s p a c e " : " d o c u m e n t a t i o n : 2 . 0 " } ;
/*!]]>*/< / script >
< script type = "text/javascript" charset = "utf-8" src = "lib/exe/js.php.t.bootstrap3.js" > < / script >
2017-02-07 17:35:26 +01:00
<!-- //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
2018-03-08 13:29:31 +01:00
< script type = "text/javascript" src = "/static/bwr/jquery-ui/jquery-ui.min.js" > < / script >
2017-02-07 17:35:26 +01:00
//else -->
2018-03-08 13:29:31 +01:00
< script type = "text/javascript" src = "/static/bwr/jquery-ui/jquery-ui.js" > < / script >
2017-02-07 17:35:26 +01:00
<!-- //endif -->
2016-10-15 19:57:04 +02:00
< / head >
< body >
< div class = "dokuwiki export container" >
< h1 class = "sectionedit1" id = "mongodb_configuration_backends" > MongoDB configuration backends< / h1 >
< div class = "level1" >
< p >
< a href = "https://www.mongodb.org/" class = "urlextern" title = "https://www.mongodb.org/" rel = "nofollow" > MongoDB< / a > is a NoSQL database that can be used both for storing configuration and < a href = "mongodbsessionbackend.html" class = "wikilink1" title = "documentation:2.0:mongodbsessionbackend" > sessions< / a > . You need to install Perl MongoDB module to be able to use this backend.
< / p >
< p >
See < a href = "changeconfbackend.html" class = "wikilink1" title = "documentation:2.0:changeconfbackend" > how to change configuration backend< / a > to change your configuration database.
< / p >
< / div >
<!-- EDIT1 SECTION "MongoDB configuration backends" [1 - 366] -->
< h2 class = "sectionedit2" id = "configuration" > Configuration< / h2 >
< div class = "level2" >
< p >
To use a MongoDB backend, configure your < code > lemonldap-ng.ini< / code > file (section configuration) :
< / p >
< ul >
< li class = "level1" > < div class = "li" > Choose MongoDB as type< / div >
< / li >
< li class = "level1" > < div class = "li" > Set dbName and collectionName parameters if different than default values (llConfDB and configuration)< / div >
< / li >
< li class = "level1" > < div class = "li" > Set host and if needed db_name username, password and ssl fields as follow.< / div >
< / li >
< / ul >
< p >
Example :
< / p >
< pre class = "code ini" > < span class = "re0" > < span class = "br0" > [ < / span > configuration< span class = "br0" > ] < / span > < / span >
< span class = "re1" > type< / span > < span class = "sy0" > =< / span > < span class = "re2" > MongoDB< / span >
< span class = "re1" > dbName< / span > < span class = "sy0" > =< / span > < span class = "re2" > llConfDB< / span >
< span class = "re1" > collectionName< / span > < span class = "sy0" > =< / span > < span class = "re2" > configuration< / span >
< span class = "re1" > host< / span > < span class = "sy0" > =< / span > < span class = "re2" > 127.0.0.1:27017< / span >
< span class = "re1" > ssl< / span > < span class = "sy0" > =< / span > < span class = "re2" > 1< / span >
< span class = "co0" > ; authentication parameters< / span >
< span class = "re1" > db_name< / span > < span class = "sy0" > =< / span > < span class = "re2" > admin< / span >
< span class = "re1" > user< / span > < span class = "sy0" > =< / span > < span class = "re2" > lluser< / span >
< span class = "re1" > password< / span > < span class = "sy0" > =< / span > < span class = "re2" > llpassword< / span > < / pre >
< div class = "table sectionedit3" > < table class = "inline table table-bordered table-striped" >
< thead >
< tr class = "row0 roweven" >
< th class = "col0 centeralign" colspan = "3" > Optional parameters (see < a href = "http://search.cpan.org/perldoc?MongoDB%3A%3AMongoClient" class = "urlextern" title = "http://search.cpan.org/perldoc?MongoDB%3A%3AMongoClient" rel = "nofollow" > MongoDB::MongoClient< / a > man page) < / th >
< / tr >
< tr class = "row1 rowodd" >
< th class = "col0 centeralign" > Name < / th > < th class = "col1 centeralign" > Comment < / th > < th class = "col2 centeralign" > Example < / th >
< / tr >
< / thead >
< tr class = "row2 roweven" >
2017-02-07 17:35:26 +01:00
< td class = "col0 leftalign" > db_name < / td > < td class = "col1 leftalign" > Admin database (default: admin) < / td > < td class = "col2 leftalign" > admin < / td >
2016-10-15 19:57:04 +02:00
< / tr >
< tr class = "row3 rowodd" >
< td class = "col0 leftalign" > auth_mechanism < / td > < td class = "col1 leftalign" > Authentication mechanism < / td > < td class = "col2 leftalign" > PLAIN < / td >
< / tr >
< tr class = "row4 roweven" >
< td class = "col0" > auth_mechanism_properties < / td > < td class = "col1 leftalign" > < / td > < td class = "col2 leftalign" > < / td >
< / tr >
< tr class = "row5 rowodd" >
< td class = "col0 leftalign" > connect_timeout < / td > < td class = "col1 leftalign" > Connection timeout < / td > < td class = "col2 leftalign" > 10000 < / td >
< / tr >
< tr class = "row6 roweven" >
< td class = "col0 leftalign" > ssl < / td > < td class = "col1" > Boolean or hash ref (default: 0) < / td > < td class = "col2 leftalign" > 1 < / td >
< / tr >
< tr class = "row7 rowodd" >
< td class = "col0 leftalign" > username < / td > < td class = "col1 leftalign" > Username to use to connect < / td > < td class = "col2 leftalign" > lluser < / td >
< / tr >
< tr class = "row8 roweven" >
< td class = "col0 leftalign" > password < / td > < td class = "col1 leftalign" > Password < / td > < td class = "col2" > llpassword < / td >
< / tr >
< / table > < / div >
<!-- EDIT3 TABLE [922 - 1688] -->
< / div >
<!-- EDIT2 SECTION "Configuration" [367 - 1689] -->
< h1 class = "sectionedit4" id = "mini_mongodb_howto" > Mini MongoDB howto< / h1 >
< div class = "level1" >
< p >
Just some commands needed to create collection and user:
< / p >
< pre class = "code" > $ mongo
connecting to: test
> use configuration
switched to db configuration
> db.createCollection(" configuration" )
...
> db.addUser({user:" lluser" ,pwd:" llpassword" ,roles:[" readWrite" ]})
...
> exit
bye
$< / pre >
< / div >
<!-- EDIT4 SECTION "Mini MongoDB howto" [1690 - ] --> < / div >
< / body >
< / html >