sudo apt update
sudo apt install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
sudo mkdir -p /var/www/hm25
sudo chown -R www-data:www-data /var/www/hm25
sudo chmod -R 755 /var/www/hm25
sudo apt install git
sudo apt install curl
For latest version, please refer to https://github.com/nvm-sh/nvm/releases
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
then
source ~/.bashrc
nvm install --lts
curl -fsSL https://get.pnpm.io/install.sh | sh -
source ~/.bashrc
verify installation
pnpm -v
git clone https://github.com/icyblob/hm25-frontend
pnpm install
REACT_APP_HTTP_ENDPOINT=http://<server_ip> pnpm build
Add your <server_ip>
in the command to set the REACT_APP_HTTP_ENDPOINT
in this file
If no errors, it's ready for the deployment
Use either scp
or rsync
# At the HM25 repo's root directory
scp -r build/* user@your_server_ip:/var/www/hm25
rsync -avzHit build/* user@your_server_ip:/var/www/hm25
sudo vim /etc/nginx/sites-available/hm25
Copy the below
server {
listen 8081;
server_name <your_server_ip>;
root /var/www/hm25;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
Create symlink
# Remove sites default
rm /etc/nginx/sites-available/default
rm /etc/nginx/sites-enabled/default
# Enable the current config
sudo ln -s /etc/nginx/sites-available/hm25 /etc/nginx/sites-enabled/
sudo nginx -t
# If it shows
# nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
# nginx: configuration file /etc/nginx/nginx.conf test is successful
# then go ahead with this command
sudo systemctl reload nginx
Open the app through http://<your_server_ip>:8081
If you have already launched the node with <node_ip>, try to connect it with our frontend. Open the Lock/Unlock icon at the top right of the app, select Connect to Server
, then add your node url:
http://<node_ip>
Then refresh the page