2020-05-14 23:29:41 +02:00
|
|
|
MongoDB session backend
|
|
|
|
=======================
|
|
|
|
|
|
|
|
`Apache::Session::MongoDB <https://metacpan.org/pod/Apache::Session::MongoDB>`__
|
|
|
|
is a faster shareable session backend.
|
|
|
|
|
|
|
|
|
2020-05-21 15:13:24 +02:00
|
|
|
.. attention::
|
2020-05-14 23:29:41 +02:00
|
|
|
|
|
|
|
Use an up-to-date version of Apache::Session::MongoDB, at least 1.8.1.
|
|
|
|
|
|
|
|
Setup
|
|
|
|
-----
|
|
|
|
|
|
|
|
Install and launch a `MongoDB server <https://www.mongodb.org/>`__.
|
|
|
|
Install
|
|
|
|
`Apache::Session::MongoDB <http://search.cpan.org/perldoc?Apache::Session::MongoDB>`__
|
|
|
|
Perl module (version ⩾ 0.15 required). You also need a recent version of
|
|
|
|
`Perl MongoDB
|
|
|
|
client <http://search.cpan.org/~mongodb/MongoDB-v1.2.2/>`__ (version ⩾
|
|
|
|
1.00 required).
|
|
|
|
|
2021-07-09 17:08:21 +02:00
|
|
|
For Debian, you can install mongodb module and Apache::Session module with:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
apt install libmongodb-perl
|
|
|
|
cpan Apache::Session::MongoDB
|
|
|
|
|
|
|
|
For CentOS:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
yum install perl-MongoDB
|
|
|
|
cpan Apache::Session::MongoDB
|
|
|
|
|
|
|
|
|
2020-05-14 23:29:41 +02:00
|
|
|
In the manager: set
|
|
|
|
`Apache::Session::MongoDB <http://search.cpan.org/perldoc?Apache::Session::MongoDB>`__
|
|
|
|
in ``General parameters`` » ``Sessions`` » ``Session storage`` »
|
|
|
|
``Apache::Session module`` and add the following parameters (case
|
|
|
|
sensitive):
|
|
|
|
|
|
|
|
============================= ============================================================================================ ===============
|
2020-05-18 09:56:39 +02:00
|
|
|
Optional parameters
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------
|
2020-05-14 23:29:41 +02:00
|
|
|
Name Comment Example
|
2020-05-18 09:56:39 +02:00
|
|
|
============================= ============================================================================================ ===============
|
2020-05-14 23:29:41 +02:00
|
|
|
**host** `MongoDB server URI <https://metacpan.org/pod/MongoDB::MongoClient#CONNECTION-STRING-URI>`__ 127.0.0.1:27017
|
|
|
|
**db_name** Session database (default: sessions) llconfdb
|
|
|
|
**collection** Collection (default: sessions) sessions
|
|
|
|
**auth_mechanism** Authentication mechanism PLAIN
|
2020-05-18 09:56:39 +02:00
|
|
|
**auth_mechanism_properties**
|
2020-05-14 23:29:41 +02:00
|
|
|
**connect_timeout** Connection timeout 10000
|
|
|
|
**ssl** Boolean or hash ref (default: 0) 1
|
|
|
|
**username** Username to use to connect lluser
|
|
|
|
**password** Password llpassword
|
|
|
|
============================= ============================================================================================ ===============
|
|
|
|
|
|
|
|
Advanced connection parameters (Replica Sets, timeouts...) may be
|
|
|
|
specified in the ``host`` parameter. `Refer to the perl MongoDB
|
|
|
|
documentation for
|
|
|
|
details <https://metacpan.org/pod/MongoDB::MongoClient#CONNECTION-STRING-URI>`__
|
|
|
|
|
|
|
|
Security
|
|
|
|
--------
|
|
|
|
|
|
|
|
Restrict network access to the MongoDB server. For remote servers, you
|
|
|
|
can use :doc:`SOAP session backend<soapsessionbackend>` in cunjunction
|
|
|
|
to increase security for remote server that access through an unsecure
|
|
|
|
network
|