Ken Robinson's picture

A while back I installed TKL Mayan EDMS v17.1 and do what I always do and rename the host and set the IP performance updates and such then reboot. I tried to access the app and no happy page, just a sad bad gateway message. I thought this ISO was broke so I opened an issue on GitHub tracker and dug into the log files. Here it was the rename of the host that broke it. Long story short,  RabbitMQ uses the hostname to create its config files, so changing the name breaks it. I wrote a quick and dirty guide on how to rename the host. I posted the guide out on GitHub but thought I would post it here too

The full issue can be found here "Mayan EDMS v17.1 - Changing Hostname Breaks App"

 

 

To rename the Mayan EDMS v17.1 server:

Overview

  1. Stop services
  2. Change name with confconsole
  3. Rename RabbitMQ Server & Reset Data
  4. Re-add RabbitMQ Data (mayan user and vhost)
  5. Reboot

You will need to know the RabbitMQ password that is being used, you can find that in the config file:
nano /opt/mayan-edms/media/config.yml

# Inside /opt/mayan-edms/media/config.yml
..
CELERY_BROKER_URL: amqp://mayan:PASSWORD_WILL_BE_HERE@127.0.0.1:5672/mayan
..

Details:

Step 1 - Stop services

Stop the Mayan EDMS
supervisorctl stop all

Stop Rabbit service
systemctl stop rabbitmq-server.service

Step 2 - Change name with confconsole

run confconsole and change the hostname, do not restart network

Step 3 - Rename RabbitMQ Server & Reset Data

Edit RabbitMQ config, change the
nano /etc/rabbitmq/rabbitmq-env.conf

# in file /etc/rabbitmq/rabbitmq-env.conf
..
NODENAME=mayan@custom-server-name-here
..

Start RabbitMQ
systemctl start rabbitmq-server.service

Stop RabbitMQ node and reset data
rabbitmqctl stop_app
rabbitmqctl reset

Restart node
rabbitmqctl start_app

Step 4 - Re-add RabbitMQ Data

Add user
rabbitmqctl add_user mayan YOUR_PASSWORD_FROM_ENV_FILE

Add vhost
rabbitmqctl add_vhost mayan

Add permissions
rabbitmqctl set_permissions -p mayan mayan ".*" ".*" ".*"

Step 5 - Reboot and Confirm

Reboot the server and check that all is well

Forum: 
Jeremy Davis's picture

TBH that does look like a bit of a PITA, but actually not as bad as it might have been.

Thanks as er always for sharing your experience and bonus points for such a clear write up. Love your work mate! :)

Add new comment