The whole story is based on Ubuntu 18.04 LTS, for different system you need to adapt accordingly
- Download binary from - in my case it is mercure_X.X.X_Linux_x86_64.tar.gz
- move it to /usr/sbin
- generate jwt keys
ssh-keygen -t rsa -b 4096 -m PEM -f jwt.key
openssl rsa -in jwt.key -pubout -outform PEM -out jwt.key.pub
- move them to /etc/mercure
- create
mercure.yaml
config file in/etc/mercure
- with just one entry
addr: 127.0.0.1:3333
- with just one entry
- first run try:
JWT_KEY=`cat jwt.key.pub` /usr/sbin/mercure
- should start the server with message similar to thisINFO[0000] Mercure started addr="127.0.0.1:3333" protocol=http
- create
/etc/systemd/system/mercure.service
with below content[Unit] Description=Mercure.Rocks service After=network.target StartLimitBurst=5 StartLimitIntervalSec=33 [Service] Type=simple WorkingDirectory=/tmp Environment=JWT_KEY=`cat jwt.key.pub` ExecStart=/usr/sbin/mercure StandardOutput=file:/var/log/mercure.log StandardError=file:/var/log/mercure.log Restart=always RestartSec=5 [Install] WantedBy=multi-user.target
- run
sudo systemctl daemon-reload
- run
sudo systemctl enable mercure.service
- run
sudo systemctl start mercure.service
- and to see if it is working run
sudo systemctl status mercure