Merge remote-tracking branch 'origin/versions/micro' into merges/micro_to_minor
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -51,7 +51,8 @@ For another setup that offers more performance and scalability refer to the
|
||||
3. Create the parent directory where the project will be deployed:
|
||||
------------------------------------------------------------------
|
||||
``/opt/`` is a good choice as it is meant is for "software and add-on packages
|
||||
that are not part of the default installation". (https://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/opt.html)
|
||||
that are not part of the default installation". (https://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/opt.html).
|
||||
Create the ``/opt`` directory if it doesn't already exists.
|
||||
::
|
||||
|
||||
sudo mkdir /opt
|
||||
@@ -63,35 +64,35 @@ For another setup that offers more performance and scalability refer to the
|
||||
of the Python packages in the system.
|
||||
::
|
||||
|
||||
sudo virtualenv /opt/mayan-edms -p /usr/bin/python3
|
||||
sudo virtualenv |MAYAN_INSTALLATION_DIRECTORY| -p /usr/bin/python3
|
||||
|
||||
|
||||
5. Make the mayan user the owner of the installation directory:
|
||||
---------------------------------------------------------------
|
||||
::
|
||||
|
||||
sudo chown mayan:mayan /opt/mayan-edms -R
|
||||
sudo chown mayan:mayan |MAYAN_INSTALLATION_DIRECTORY| -R
|
||||
|
||||
|
||||
6. Install Mayan EDMS from PyPI:
|
||||
--------------------------------
|
||||
::
|
||||
|
||||
sudo -u mayan /opt/mayan-edms/bin/pip install --no-cache-dir --no-use-pep517 mayan-edms
|
||||
sudo -u mayan |MAYAN_PIP_BIN| install --no-cache-dir --no-use-pep517 mayan-edms
|
||||
|
||||
|
||||
7. Install the Python client for PostgreSQL and Redis:
|
||||
------------------------------------------------------
|
||||
::
|
||||
|
||||
sudo -u mayan /opt/mayan-edms/bin/pip install --no-cache-dir --no-use-pep517 psycopg2==|PYTHON_PSYCOPG2_VERSION| redis==|PYTHON_REDIS_VERSION|
|
||||
sudo -u mayan |MAYAN_PIP_BIN| install --no-cache-dir --no-use-pep517 psycopg2==|PYTHON_PSYCOPG2_VERSION| redis==|PYTHON_REDIS_VERSION|
|
||||
|
||||
.. note::
|
||||
|
||||
Platforms with the ARM CPU might also need additional requirements.
|
||||
::
|
||||
|
||||
sudo -u mayan /opt/mayan-edms/bin/pip install --no-cache-dir --no-use-pep517 psutil==|PYTHON_PSUTIL_VERSION|
|
||||
sudo -u mayan |MAYAN_PIP_BIN| install --no-cache-dir --no-use-pep517 psutil==|PYTHON_PSUTIL_VERSION|
|
||||
|
||||
|
||||
8. Create the database for the installation:
|
||||
@@ -120,16 +121,17 @@ For another setup that offers more performance and scalability refer to the
|
||||
.. warning::
|
||||
|
||||
If this step is interrupted, even if it is later resumed, will
|
||||
cause the automatic admin user to not be created in some cases. Make sure all
|
||||
environment variable and values are correct. If this happens, refer to the
|
||||
troubleshooting chapters: :ref:`troubleshooting-autoadmin-account` and
|
||||
cause the automatic admin user to not be created in some cases. Make
|
||||
sure all environment variables and values are correct. If this
|
||||
happens, refer to the troubleshooting chapters:
|
||||
:ref:`troubleshooting-autoadmin-account` and
|
||||
:ref:`troubleshooting-admin-password`.
|
||||
|
||||
::
|
||||
|
||||
sudo -u mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" \
|
||||
MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
|
||||
/opt/mayan-edms/bin/mayan-edms.py initialsetup
|
||||
MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| \
|
||||
|MAYAN_BIN| initialsetup
|
||||
|
||||
|
||||
10. Collect the static files:
|
||||
@@ -139,17 +141,17 @@ For another setup that offers more performance and scalability refer to the
|
||||
|
||||
::
|
||||
|
||||
sudo -u mayan MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
|
||||
/opt/mayan-edms/bin/mayan-edms.py preparestatic --noinput
|
||||
sudo -u mayan MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| \
|
||||
|MAYAN_BIN| preparestatic --noinput
|
||||
|
||||
|
||||
11. Create the supervisor file at ``/etc/supervisor/conf.d/mayan.conf``:
|
||||
11. Create the supervisor file at ``|MAYAN_SUPERVISOR_CONF|``:
|
||||
------------------------------------------------------------------------
|
||||
::
|
||||
|
||||
sudo mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" \
|
||||
MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
|
||||
/opt/mayan-edms/bin/mayan-edms.py platformtemplate supervisord > /etc/supervisor/conf.d/mayan.conf
|
||||
MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| \
|
||||
|MAYAN_BIN| platformtemplate supervisord > |MAYAN_SUPERVISOR_CONF|
|
||||
|
||||
|
||||
12. Configure Redis:
|
||||
@@ -204,7 +206,7 @@ of a restart or power failure. The Gunicorn workers are increased to 3.
|
||||
------------------------------------------
|
||||
::
|
||||
|
||||
sudo -u mayan /opt/mayan-edms/bin/pip install --no-cache-dir --no-use-pep517 librabbitmq==|PYTHON_LIBRABBITMQ_VERSION|
|
||||
sudo -u mayan |MAYAN_PIP_BIN| install --no-cache-dir --no-use-pep517 librabbitmq==|PYTHON_LIBRABBITMQ_VERSION|
|
||||
|
||||
|
||||
3. Create the RabbitMQ user and vhost:
|
||||
@@ -216,7 +218,7 @@ of a restart or power failure. The Gunicorn workers are increased to 3.
|
||||
sudo rabbitmqctl set_permissions -p mayan mayan ".*" ".*" ".*"
|
||||
|
||||
|
||||
4. Edit the supervisor file at ``/etc/supervisor/conf.d/mayan.conf``:
|
||||
4. Edit the supervisor file at ``|MAYAN_SUPERVISOR_CONF|``:
|
||||
---------------------------------------------------------------------
|
||||
Replace (paying attention to the comma at the end)::
|
||||
|
||||
@@ -228,7 +230,7 @@ of a restart or power failure. The Gunicorn workers are increased to 3.
|
||||
|
||||
increase the number of Gunicorn workers to 3 in the line (``-w 2`` section)::
|
||||
|
||||
command = /opt/mayan-edms/bin/gunicorn -w 2 mayan.wsgi --max-requests 1000 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000 --timeout 120
|
||||
command = |MAYAN_GUNICORN_BIN| -w 2 mayan.wsgi --max-requests 1000 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000 --timeout 120
|
||||
|
||||
remove the concurrency limit (or increase it) of the fast worker (remove ``--concurrency=1``).
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ Increase this number to match the number of CPU cores + 1.
|
||||
|
||||
If you are using the direct deployment methods, change the line that reads::
|
||||
|
||||
command = /opt/mayan-edms/bin/gunicorn -w 2 mayan.wsgi --max-requests 500 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000 --timeout 120
|
||||
command = |MAYAN_GUNICORN_BIN| -w 2 mayan.wsgi --max-requests 500 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000 --timeout 120
|
||||
|
||||
And increase the value of the ``-w 2`` argument. This line is found in the
|
||||
``[program:mayan-gunicorn]`` section of the supervisor configuration file.
|
||||
|
||||
@@ -58,12 +58,14 @@ to be valid. You can revert manually by copy the file or by using the
|
||||
Via Python settings files
|
||||
=========================
|
||||
|
||||
Another way to configure Mayan EDMS is via Python-style, settings files.
|
||||
Another way to configure Mayan EDMS and the one required when more extensive
|
||||
setup is required, such as when using external Python libraries, is via
|
||||
Python-style, settings files.
|
||||
If Mayan EDMS was installed using the Python package a ``mayan_settings``
|
||||
folder will created for this purpose. If you installed Mayan EDMS
|
||||
according to the :doc:`../chapters/deploying` instructions provided in this
|
||||
documentation your ``mayan_settings`` folder should be located in the directory:
|
||||
``/usr/share/mayan-edms/mayan/media/mayan_settings``.
|
||||
``|MAYAN_MEDIA_ROOT|/mayan_settings/``.
|
||||
|
||||
If Mayan EDMS was installed using Docker, the ``mayan_settings`` folder
|
||||
will be found inside the install Docker volume. If you installed Mayan EDMS
|
||||
@@ -100,12 +102,23 @@ For the :doc:`../chapters/deploying` method, the full import path will be
|
||||
``mayan.media.mayan_settings.mysettings`` and can be passed via the
|
||||
``--settings`` command line argument like this::
|
||||
|
||||
python manage.py runserver --settings=mayan.media.mayan_settings.mysettings
|
||||
|MAYAN_BIN| runserver --settings=mayan.media.mayan_settings.mysettings
|
||||
|
||||
or via the ``DJANGO_SETTINGS_MODULE`` environment variable like this::
|
||||
|
||||
export DJANGO_SETTINGS_MODULE=mayan.media.mayan_settings.mysettings
|
||||
|
||||
To make the use of the custom Python setting file permanent, update the ``|MAYAN_SUPERVISOR_CONF|``
|
||||
file. In the ``[supervisord]`` section, update the ``environment=`` value of
|
||||
``DJANGO_SETTINGS_MODULE`` from the default ``mayan.settings.production`` to
|
||||
``mayan.media.mayan_settings.mysettings``. Pay attention to the indentation of
|
||||
the ``environment=`` entries.
|
||||
|
||||
Force supervisor to read the changes and restart using::
|
||||
|
||||
sudo supervisorctl reread
|
||||
sudo supervisorctl restart all
|
||||
|
||||
For the :doc:`../chapters/docker` installation method, the full import path will be
|
||||
``mayan_settings.mysettings`` and can only be passed via the
|
||||
``MAYAN_SETTINGS_MODULE`` environment variable like this::
|
||||
|
||||
Reference in New Issue
Block a user