-
Notifications
You must be signed in to change notification settings - Fork 4
Deployment on RHEL based distro
Make sure to follow the corresponding deployment guide for BudLib API, which is available at https://github.com/budlib/budlib-api/wiki/Deployment-on-RHEL-based-distro.
-
Make sure you have
nodejs
installed and setup on your system. If not, you can getnodejs
from https://nodejs.org/en/download/. -
Clone the budlib-web repository from https://github.com/budlib/budlib-web to your local system
$ git clone https://github.com/budlib/budlib-web.git # mv budlib-web /usr/local/bin
-
Navigate to the repository and run the following commands
$ cd /usr/local/bin/budlib-web $ npm install $ npm run build $ npm install -g serve
-
To start react server on port
80
, install the dependency and give safe user permission to node# dnf install libcap-devel # setcap cap_net_bind_service=+ep `readlink -f \`which node\``
-
Create a script that would start the server
# touch /usr/local/bin/budlib-web.sh # chmod +x /usr/local/bin/budlib-web.sh
-
Add the following content in the file created in Step 5. Make sure to update the path to your installed node in the below content (
node
path our case the path is/opt/node-v16.15.0/bin
)#!/bin/bash export PATH="${PATH}:/opt/node-v16.15.0/bin" cd /usr/local/bin/budlib-web nohup `which serve` -s build -l 80
-
Create a service file for the budlib-web, that would run the web server it on system start-up
# touch /etc/systemd/system/budlib-web.service
-
Add the content in the file created in Step 7, as shown:
[Unit] Description=Web Interface for BudLib Wants=network.target budlib-api.service After=syslog.target network-online.target budlib-api.service [Service] Type=simple User=$USER ExecStart=/usr/local/bin/budlib-web.sh Restart=on-failure RestartSec=10 KillMode=mixed [Install] WantedBy=multi-user.target
Note: replace
$USER
with your system username, orroot
-
Enable the budlib-web to run on system startup
# systemctl daemon-reload # systemctl enable budlib-web.service