Instalasi Mayan EDMS¶
Server database¶
Siapkan 1 server dengan sistem operasi Ubuntu 18.04 LTS untuk sebagai peladen pangkalan data:
- Instalasi PostgreSQL
- Konfigurasi klien agar dapat komunikasi ke server db
3.
sudo apt-get install postgresql
sudo nano /etc/postgresql/10/main/postgresql.conf
listen_addresses = 'localhost,10.130.33.62,178.128.23.204'
#listen_addresses = 'localhost' # what IP address(es) to listen on;
sudo nano /etc/postgresql/10/main/pg_hba.conf
# remote client IP
host all all 68.183.189.94/32 md5
host proxsis_me33 pcg_me33 10.130.82.215/16 md5
sudo sytemctl restart postgresql
sudo -u postgres psql -c "CREATE USER pcg_me3 WITH password 'd%EmZZ2ZpB^cszDH';"
sudo -u postgres createdb -O pcg_me3 proxsis_me33
Server aplikasi¶
Siapkan 1 server dengan sistem operasi Debian 10 untuk sebagai peladen aplikasi:
sudo apt-get install -y \
coreutils exiftool g++ gcc ghostscript gnupg1 graphviz libfuse2 \
libjpeg-dev libmagic1 libpng-dev libpq-dev libreoffice libtiff-dev \
poppler-utils postgresql-client python3-dev python3-venv python3-virtualenv \
rabbitmq-server redis-server sane-utils supervisor tesseract-ocr zlib1g-dev
psql -h10.130.33.62 -Upcg_me3 -dproxsis_me33 -W
#
sudo adduser mayan --home /opt/mayan-edms --disabled-password --disabled-login --gecos ""
#
sudo virtualenv /opt/mayan-edms -p $(which python3)
#
sudo chown -Rv mayan:mayan /opt/mayan-edms*
#
sudo -u mayan /opt/mayan-edms/bin/pip install --no-cache-dir --no-use-pep517 mayan-edms==3.3.9 psycopg2==2.8.3 redis==3.3.11 amqp==2.5.2
sudo -u mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'proxsis_me33','PASSWORD':'d%EmZZ2ZpB^cszDH','USER':'pcg_me3','HOST':'10.130.33.62'}}" \
MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
/opt/mayan-edms/bin/mayan-edms.py initialsetup
sudo -u mayan MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
/opt/mayan-edms/bin/mayan-edms.py preparestatic --noinput
Supervisor¶
sudo -u mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'proxsis_me33','PASSWORD':'d%EmZZ2ZpB^cszDH','USER':'pcg_me3','HOST':'10.130.33.62'}}" \
MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
/opt/mayan-edms/bin/mayan-edms.py platformtemplate supervisord | sudo sh -c "cat > /etc/supervisor/conf.d/mayan.conf"
cat /etc/supervisor/conf.d/mayan.conf
Server Redis¶
Performa rendah
sudo -u mayan /opt/mayan-edms/bin/pip install --no-use-pep517 redis==3.3.11
#
echo "maxmemory-policy allkeys-lru" | sudo tee -a /etc/redis/redis.conf
echo "save \"\"" | sudo tee -a /etc/redis/redis.conf
echo "databases 2" | sudo tee -a /etc/redis/redis.conf
#
sudo systemctl restart redis
Server RabitMQ¶
Performa tinggi
sudo -u mayan /opt/mayan-edms/bin/pip install --no-use-pep517 amqp==2.5.2
sudo rabbitmqctl add_user mayan mayanRabbitMQpassworD
sudo rabbitmqctl add_vhost mayan
sudo rabbitmqctl set_permissions -p mayan mayan ".*" ".*" ".*"
sudo nano /etc/supervisor/conf.d/mayan.conf
MAYAN_CELERY_BROKER_URL="amqp://mayan:mayanRabbitMQpassworD@localhost:5672/mayan",
# MAYAN_CELERY_BROKER_URL="redis://127.0.0.1:6379/0",
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
# remove the concurrency limit (or increase it) of the fast worker (remove --concurrency=1)
Penyelesaian¶
sudo systemctl enable supervisor
sudo systemctl restart supervisor
sudo apt-get remove --purge libjpeg-dev libpq-dev libpng-dev libtiff-dev zlib1g-dev
sudo supervisorctl reread
sudo supervisorctl restart all