MNApp Hosting Guide Using Nginx

A comprehensive guide to hosting your first MNApp

The server specifications such as storage and bandwidth for hosting an MNApp are dependent on the user's requirements. For example, a video streaming platform may require more storage than an information sharing platform.

However, you need a Linux system with Ubuntu 18.04 or 20.04 to run an MNApp.

Step 1: Install BelNet on Your System and Generate Your Belnet Address

Download and run the binaries

Enter the following command into the terminal to download the Belnet binaries from cloud

wget 
https://deb.beldex.io/Beldex-projects/Belnet/deps/v0.9.6/linux/belnet-linux-x86_64-v0.9.6.zip

Unzip the file using the following command

unzip belnet-linux-x86_64-v0.9.6.zip

Run the Belnet binary

sudo ./belnet

Then, copy and paste the following command to open the belnet.ini file.

sudo vim /var/lib/belnet/belnet.ini

Scroll down to the [network] section and configure the keyfile by giving it a name of your choice. Your MNApp private key will be stored in the following path. Here, we’ve named our keyfile, mnappkey.private

keyfile=/var/lib/belnet/mnappkey.private

Enter the following command and restart the Belnet client

sudo ./belnet

Step 2: Find Your MNApp’s BelNet Address

To find your MNApp address, enter the following command.

host -t cname localhost.bdx 127.3.2.1

For example, this is the MNApp address for the Beldex explorer hosted on BelNet cw41adqqhykuxw51xmagkkb3fixyieat1josbux13jn6o973tqgy.bdx

Step 3: Download and Install Nginx

Nginx is a dependency. So download and install it using the following commands

sudo apt update
sudo apt install nginx

Use the following command to check whether nginx is working

systemctl status nginx

Step 4: Setup Your MNApp Web Page

Your web content goes into this directory

Create a directory using the following command. Give a name to your directory. You can do this by replacing your_own-directory in the command below with your directory name.

sudo  mkdir /var/www/your_own_directory/

Place your html web page into this directory

Step 5: Configure Nginx

Below is a sample configuration of Nginx

Enter the following commands

sudo cd /etc/nginx/sites-available
sudo vim default

Now enter your directory’s name (established in Step 4) in place of your_own_directory in the command below.

root /var/www/your_own_directory; 

Add the index file of your webpage here using the following command.

Note: Replace your_webpage with the filename that you want to assign to your index html file.

index your_webpage.html;

Now choose a server name by entering the following command. Replace the sample BelNet address below with your MNApp’s BelNet address generated in Step 2.

server_name cw41adqqhykuxw51xmagkkb3fixyieat1josbux13jn6o973tqgy.bdx;

Save it by pressing Esc and then :wq

Restart Nginx using the following command

sudo systemctl restart nginx.service

To access your MNApps, connect to BelNet and enter the MNApp’s BelNet address into a browser’s address bar

e.g. http://cw41adqqhykuxw51xmagkkb3fixyieat1josbux13jn6o973tqgy.bdx/

Note: You cannot host a masternode and an MNApp in the same server. You cannot host a BelNet exit node and an MNApp in the same server.

Last updated