How VPS - How to use/setup VPS
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

How to Install NodeBB on CentOS 7

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
35
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Step 1: Update the system
  3. Step 2: Install dependencies for NodeBB
  4. Step 3: Install NodeJS using nvm
  5. Step 4: Install NodeBB
  6. Step 6: Setup an Nginx reverse proxy
  7. Step 7: Modify firewall rules in order to allow visitors’ access:
  8. Step 8: Access NodeBB
  9. Want to contribute?


NodeBB is a modern, open source, and NodeJS-based forum software.

With customers in mind, NodeBB offers community owners powerful features and ease of use to drive community engagement.

In this article, we will be installing NodeBB on CentOS 7.

Prerequisites

  • A newly deployed Vultr CentOS 7 x64 server instance at least 1 GB RAM.
  • Logging in as the root user.
  • The EPEL yum repository.

Step 1: Update the system

Log in to your server via SSH using the sudo user to install epel, update the system, and restart to apply the updates.

yum install epel-release -y
yum update -y && sudo shutdown -r now

Step 2: Install dependencies for NodeBB

Next, we will install all the NodeBB required system dependancies:

yum -y groupinstall "Development Tools"
yum -y install git redis ImageMagick npm

Start redis and make it run at each and every system startup:

systemctl start redis.service
systemctl enable redis.service

Step 3: Install NodeJS using nvm

Use the following commands to install NodeJS v6.9.5—the latest LTS release of NodeJS at the time this article was written.

Note: The second command below will invoke nvm v0.33.0, the latest release of nvm at the time of writing this article. You can always check out the latest release of nvm here and then modify that command accordingly.

cd
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
source ~/.bash_profile
nvm list-remote
nvm install v6.9.5

Step 4: Install NodeBB

Install the latest release of NodeBB, NodeBB v1.4.3, as follows:

cd /opt
git clone -b v1.4.3 https://github.com/NodeBB/NodeBB nodebb
cd nodebb
npm install

After the installation, run the ./nodebb script with the setup flag in order to setup NodeBB:

./nodebb setup

Answer a few questions as follows in order to use the default settings with a redis database. When appropriate, press Enter to accept the default setting shown in brackets.

  • URL used to access this NodeBB (http://localhost:4567) <Enter>
  • Please enter a NodeBB secret (bb3244f1-3a7e-4ee2-bc77-5032fd4c8b00) <Enter>
  • Which database to use (mongo) redis
  • Host IP or address of your Redis instance (127.0.0.1) <Enter>
  • Host port of your Redis instance (6379) <Enter>
  • Password of your Redis database <Enter>
  • Which database to use (0..n) (0) <Enter>
  • Administrator username admin
  • Administrator email address [email protected]
  • Password yourpassword
  • Confirm Password yourpassword

Having NodeBB successfully installed and configured, you can manually start/stop/restart NodeBB by running:

./nodebb start
./nodebb stop
./nodebb restart

Step 5: Keep NodeBB running using forever

Forever is a tool which can keep nodejs-based app running. In production, this is a useful feature.

First, you need to stop NodeBB:

./nodebb stop

Install forever globally:

npm install forever -g

Start NodeBB using forever:

cd /opt/nodebb
forever start app.js

You can confirm that NodeBB is running using a curl command:

curl -I http://localhost:4567

The output should resemble:

HTTP/1.1 200 OK
X-Powered-By: NodeBB
X-Frame-Options: SAMEORIGIN
Access-Control-Allow-Origin: null
Content-Type: text/html; charset=utf-8
Content-Length: 19845
ETag: W/"4d85-cXlw1a5DyxHkfjSEd7Ru5Q"
set-cookie: express.sid=s%3AqoIQ1-JSyw1tvrrhyXiP7Sm5D-gDJ9HT.Aum4qMXBPiCgZ7Il%2BtrePafZJWEt2dIJlS%2BBTRZjWZs; Path=/; Expires=Sun, 26 Feb 2017 15:14:35 GMT; HttpOnly
Vary: Accept-Encoding
Date: Sun, 12 Feb 2017 15:14:36 GMT
Connection: keep-alive

Step 6: Setup an Nginx reverse proxy

Since NodeBB is running on localhost by default, you need to setup an Nginx reverse proxy in order to allow web access.

Install Nginx using YUM:

yum install nginx -y

Modify Nginx settings:

vi /etc/nginx/nginx.conf

Find the location / {} segment within the http {} segment:

http {

    location / {
    }

}

Insert the below lines into the location / {} segment:

    proxy_pass http://127.0.0.1:4567;
    proxy_http_version 1.1;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_cache_bypass $http_upgrade;

The final result should be:

http {

location / {
    proxy_pass http://127.0.0.1:4567;
    proxy_http_version 1.1;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_cache_bypass $http_upgrade;
}

}

Save and quit:

:wq!

Start and enable the Nginx service:

systemctl start nginx.service
systemctl enable nginx.service

Step 7: Modify firewall rules in order to allow visitors’ access:

firewall-cmd --zone=public --permanent --add-service=http
firewall-cmd --reload

Step 8: Access NodeBB

Finally, point your web browser to http://203.0.113.1 to visit the newly created NodeBB website. You can log in using the admin credentials you setup earlier. Feel free to navigate and customize NodeBB after logging in as the administrator.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
How VPS

How VPS

Related Posts

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Install BoltWire CMS on CentOS 7
CentOS

How to Install BoltWire CMS on CentOS 7

February 14, 2020
Showterm.io – A Terminal/Shell Recording, Upload and Share Tool for Linux
CentOS

Setup HTTP Authentication With Nginx on CentOS 7

February 14, 2020
Next Post

Installing Odoo 10 Community on CentOS 7

Install an FTP Server With ProFTPd on CentOS 6 or CentOS 7

How to Use Mosh on CentOS 7 for Remote Server Administration

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Follow Us

  • 121 Followers
  • 87.2k Followers

Recommended

Protect SSH Access Using Spiped On OpenBSD

3 years ago

5 Command Line Ways to Find Out Linux System is 32-bit or 64-bit

4 years ago

Set Date and Time for Each Command You Execute in Bash History

4 years ago

How to Install RainLoop Webmail on Debian 9

3 years ago

Instagram

    Please install/update and activate JNews Instagram plugin.

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

Topics

Apache Web Server Bluehost Review 2019 Bluehost Review 2020 Bluehost Review 2021 Centmin Mod CentminMod centos install htop fsck htop install HTTP DoS attack Install Snort on an Ubuntu install Zabbix on CentOS install Zabbix on CentOS 7 Linux Commands linux guide linux install htop linux vps setup guide MariaDB MariaDB Error Mysql mysqld error optimize MariaDB optimize Mysql snort Ubuntu
No Result
View All Result

Highlights

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Webmin Reviews

Virtualmin Reviews

CentOS Web Panel Reviews

Ajenti Reviews

ISPConfig Reviews

Trending

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

by How VPS
February 25, 2022
0

I tried to update some extensions by use yum on centOs which I specified in Dockerfile. After...

How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020
Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Webmin Reviews

Webmin Reviews

February 17, 2020
How VPS – How to use/setup VPS

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Visit our landing page to see all features & demos.
LEARN MORE »

Recent News

  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8 February 25, 2022
  • How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”? November 17, 2020
  • How to optimize Mysql or MariaDB November 3, 2020

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

[mc4wp_form]

© 2018 JNews - City News Magazine WordPress theme. All rights belong to their respective owners.
JNews is a top selling 2018 WordPress News, Blog, Newspaper & Magazine Theme.

No Result
View All Result
  • Home

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.