From c0966e74a098e8c0483db0b0902a6d340ba46bba Mon Sep 17 00:00:00 2001 From: nova Date: Sat, 30 May 2020 16:58:03 +0000 Subject: [PATCH] --- Installation.md | 66 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/Installation.md b/Installation.md index cfcceb6..cde061a 100644 --- a/Installation.md +++ b/Installation.md @@ -17,7 +17,7 @@ chatto.datasource.params=useSSL=false Then you would need to configure a reverse proxy, preferably with SSL. You can obtain a free SSL certificate from letsencrypt (be sure to donate if possible). Below is a sample nginx config - -```nginx +``` nginx upstream chat { server 127.0.0.1:8080; } @@ -53,43 +53,55 @@ server { include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot - } - server { if ($host = chat.example.com) { return 301 https://$host$request_uri; } # managed by Certbot - if ($host = www.chat.example.com) { return 301 https://$host$request_uri; } # managed by Certbot - listen 80 ; listen [::]:80; server_name chat.example.com; return 404; # managed by Certbot } ``` -Place the file in ```bash /etc/nginx/sites-available/``` (depending on your linux distro this may differ). + +Place the file in +```bash +/etc/nginx/sites-available/ + +``` +(depending on your linux distro this may differ). Now make a symlink - -```bash sudo ln -s /etc/nginx/sites-available/chatto /nginx/sites-enabled``` +```bash +sudo ln -s /etc/nginx/sites-available/chatto /nginx/sites-enabled + +``` verify configration - -```bash sudo nginx -t``` +```bash +sudo nginx -t +``` and restart nginx - -```bash sudo systemctl restart nginx``` +```bash +sudo systemctl restart nginx +``` Now create a linux user - -```bash sudo useradd -r -s /bin/false``` +```bash +sudo useradd -r -s /bin/false +``` Next create a systemd script making use of the created user- -``` + +``` [Unit] Description=System Daemon for Chatto @@ -104,12 +116,36 @@ RestartSec=10 [Install] WantedBy=multi-user.target ``` + Take note of the spring profiles argument. It enabled the production profile. Omitting it would run the app in dev profile. -Name the file chatto.service and place it in ```/etc/systemd/systemd```. +Name the file chatto.service and place it in -Reload systemd daemon - ```bash sudo systemctl daemon-reload``` -Then start the service - ```bash sudo systemctl start chatto``` +``` +/etc/systemd/systemd + +``` +Reload systemd daemon - + +```bash +sudo systemctl daemon-reload +``` + +Then start the service - + +``` bash +sudo systemctl start chatto +``` If everything went well then the app should start. -Check with ```bash sudo systemctl status chatto``` and if it fails to start do ```sudo journalctl -u chatto``` to check the cause of the failure. +Check with + +``` bash +sudo systemctl status chatto +``` +and if it fails to start do +``` +sudo journalctl -u chatto +``` +to check the cause of the failure. +If everything went well then the app should start.