Automate paths in documentation
Paths are now configure in docs/conf.py to ensure consistency and avoid human error. Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -10,11 +10,11 @@ Direct install
|
||||
==============
|
||||
|
||||
* Make a backup of your existing SQLite database and documents by copying the
|
||||
``/opt/mayan-edms/media`` folder.
|
||||
``|MAYAN_MEDIA_ROOT|`` folder.
|
||||
* :doc:`Upgrade to at least version 3.1.3. <../releases/3.1.3>`
|
||||
* Migrate the existing SQLite database with the command ``performupgrade``::
|
||||
|
||||
sudo -u mayan MAYAN_MEDIA_ROOT=/opt/mayan-edms/media /opt/mayan-edms/bin/mayan-edms.py performupgrade
|
||||
sudo -u mayan MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| |MAYAN_BIN| performupgrade
|
||||
|
||||
* Install PostgreSQL::
|
||||
|
||||
@@ -27,11 +27,11 @@ Direct install
|
||||
|
||||
* Install the Python client for PostgreSQL::
|
||||
|
||||
sudo -u mayan /opt/mayan-edms/bin/pip install --no-cache-dir --no-use-pep517 psycopg2==2.7.3.2
|
||||
sudo -u mayan |MAYAN_PIP_BIN| install --no-cache-dir --no-use-pep517 psycopg2==2.7.3.2
|
||||
|
||||
* Copy the newly created fallback config file::
|
||||
|
||||
cp /opt/mayan-edms/media/config_backup.yml /opt/mayan-edms/media/config.yml
|
||||
cp |MAYAN_MEDIA_ROOT|/config_backup.yml |MAYAN_MEDIA_ROOT|/config.yml
|
||||
|
||||
* Edit the configuration file to add the entry for the PostgreSQL database and
|
||||
rename the SQLite database to 'old'::
|
||||
@@ -44,7 +44,7 @@ Direct install
|
||||
CONN_MAX_AGE: 0
|
||||
ENGINE: django.db.backends.sqlite3
|
||||
HOST: ''
|
||||
NAME: /opt/mayan-edms/media/db.sqlite3
|
||||
NAME: |MAYAN_MEDIA_ROOT|/db.sqlite3
|
||||
OPTIONS: {}
|
||||
PASSWORD: ''
|
||||
PORT: ''
|
||||
@@ -60,7 +60,7 @@ Direct install
|
||||
CONN_MAX_AGE: 0
|
||||
ENGINE: django.db.backends.sqlite3
|
||||
HOST: ''
|
||||
NAME: /opt/mayan-edms/media/db.sqlite3
|
||||
NAME: |MAYAN_MEDIA_ROOT|/db.sqlite3
|
||||
OPTIONS: {}
|
||||
PASSWORD: ''
|
||||
PORT: ''
|
||||
@@ -73,7 +73,7 @@ Direct install
|
||||
CONN_MAX_AGE: 0
|
||||
ENGINE: django.db.backends.postgresql
|
||||
HOST: '127.0.0.1'
|
||||
NAME: /opt/mayan-edms/media/db.sqlite3
|
||||
NAME: |MAYAN_MEDIA_ROOT|/db.sqlite3
|
||||
OPTIONS: {}
|
||||
PASSWORD: 'mayanuserpass'
|
||||
PORT: ''
|
||||
@@ -83,11 +83,11 @@ Direct install
|
||||
|
||||
* Migrate the new database to create the empty tables::
|
||||
|
||||
sudo -u mayan MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=/opt/mayan-edms/media /opt/mayan-edms/bin/mayan-edms.py migrate
|
||||
sudo -u mayan MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| |MAYAN_BIN| migrate
|
||||
|
||||
* Convert the data in the SQLite and store it in the PostgreSQL database::
|
||||
|
||||
sudo -u mayan MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=/opt/mayan-edms/media /opt/mayan-edms/bin/mayan-edms.py convertdb --from=old --to=default --force
|
||||
sudo -u mayan MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| |MAYAN_BIN| convertdb --from=old --to=default --force
|
||||
|
||||
* Update the supervisor config file to have Mayan EDMS run from the PostgreSQL database::
|
||||
|
||||
|
||||
@@ -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
|
||||
sudo virtualenv |MAYAN_INSTALLATION_DIRECTORY|
|
||||
|
||||
|
||||
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,17 +121,18 @@ 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 no 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_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan \
|
||||
MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan \
|
||||
MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
|
||||
/opt/mayan-edms/bin/mayan-edms.py initialsetup
|
||||
MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| \
|
||||
|MAYAN_BIN| initialsetup
|
||||
|
||||
|
||||
10. Collect the static files:
|
||||
@@ -140,8 +142,8 @@ 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``:
|
||||
@@ -150,8 +152,8 @@ For another setup that offers more performance and scalability refer to the
|
||||
|
||||
sudo MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan \
|
||||
MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan \
|
||||
MAYAN_DATABASE_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_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| \
|
||||
|MAYAN_BIN| platformtemplate supervisord > /etc/supervisor/conf.d/mayan.conf
|
||||
|
||||
|
||||
12. Configure Redis:
|
||||
@@ -206,7 +208,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:
|
||||
@@ -230,7 +232,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,7 +102,7 @@ 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::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user