| 1 |
MongoDB session backend (deprecated) |
| 2 |
==================================== |
| 3 |
|
| 4 |
`Apache::Session::MongoDB <https://metacpan.org/pod/Apache::Session::MongoDB>`__ |
| 5 |
is a faster shareable session backend. |
| 6 |
|
| 7 |
.. tip:: |
| 8 |
|
| 9 |
`MongoDB has officially deprecated the Perl driver <https://www.mongodb.com/blog/post/the-mongodb-perl-driver-is-being-deprecated>`__, so we advice to choose another backend |
| 10 |
|
| 11 |
|
| 12 |
.. attention:: |
| 13 |
|
| 14 |
Use an up-to-date version of Apache::Session::MongoDB, at least 1.8.1. |
| 15 |
|
| 16 |
Setup |
| 17 |
----- |
| 18 |
|
| 19 |
Install and launch a `MongoDB server <https://www.mongodb.org/>`__. |
| 20 |
Install |
| 21 |
`Apache::Session::MongoDB <http://search.cpan.org/perldoc?Apache::Session::MongoDB>`__ |
| 22 |
Perl module (version ⩾ 0.15 required). You also need a recent version of |
| 23 |
`Perl MongoDB |
| 24 |
client <http://search.cpan.org/~mongodb/MongoDB-v1.2.2/>`__ (version ⩾ |
| 25 |
1.00 required). |
| 26 |
|
| 27 |
For Debian, you can install mongodb module and Apache::Session module with: |
| 28 |
|
| 29 |
:: |
| 30 |
|
| 31 |
apt install libmongodb-perl |
| 32 |
cpan Apache::Session::MongoDB |
| 33 |
|
| 34 |
For CentOS: |
| 35 |
|
| 36 |
:: |
| 37 |
|
| 38 |
yum install perl-MongoDB |
| 39 |
cpan Apache::Session::MongoDB |
| 40 |
|
| 41 |
|
| 42 |
In the manager: set |
| 43 |
`Apache::Session::MongoDB <http://search.cpan.org/perldoc?Apache::Session::MongoDB>`__ |
| 44 |
in ``General parameters`` » ``Sessions`` » ``Session storage`` » |
| 45 |
``Apache::Session module`` and add the following parameters (case |
| 46 |
sensitive): |
| 47 |
|
| 48 |
============================= ============================================================================================ =============== |
| 49 |
Optional parameters |
| 50 |
------------------------------------------------------------------------------------------------------------------------------------------ |
| 51 |
Name Comment Example |
| 52 |
============================= ============================================================================================ =============== |
| 53 |
**host** `MongoDB server URI <https://metacpan.org/pod/MongoDB::MongoClient#CONNECTION-STRING-URI>`__ 127.0.0.1:27017 |
| 54 |
**db_name** Session database (default: sessions) llconfdb |
| 55 |
**collection** Collection (default: sessions) sessions |
| 56 |
**auth_mechanism** Authentication mechanism PLAIN |
| 57 |
**auth_mechanism_properties** |
| 58 |
**connect_timeout** Connection timeout 10000 |
| 59 |
**ssl** Boolean or hash ref (default: 0) 1 |
| 60 |
**username** Username to use to connect lluser |
| 61 |
**password** Password llpassword |
| 62 |
============================= ============================================================================================ =============== |
| 63 |
|
| 64 |
Advanced connection parameters (Replica Sets, timeouts...) may be |
| 65 |
specified in the ``host`` parameter. `Refer to the perl MongoDB |
| 66 |
documentation for |
| 67 |
details <https://metacpan.org/pod/MongoDB::MongoClient#CONNECTION-STRING-URI>`__ |
| 68 |
|
| 69 |
Security |
| 70 |
-------- |
| 71 |
|
| 72 |
Restrict network access to the MongoDB server. For remote servers, you |
| 73 |
can use :doc:`SOAP session backend<soapsessionbackend>` in cunjunction |
| 74 |
to increase security for remote server that access through an unsecure |
| 75 |
network |