Si të instaloni NodeBB në CentOS 7

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 admin@example.com
  • 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.

Lëreni një koment

Ngritja e makinave: Aplikimet në botën reale të AI

Ngritja e makinave: Aplikimet në botën reale të AI

Inteligjenca Artificiale nuk është në të ardhmen, është këtu në të tashmen Në këtë blog Lexoni se si aplikacionet e inteligjencës artificiale kanë ndikuar në sektorë të ndryshëm.

Sulmet DDOS: Një përmbledhje e shkurtër

Sulmet DDOS: Një përmbledhje e shkurtër

A jeni edhe ju viktimë e Sulmeve DDOS dhe jeni konfuz në lidhje me metodat e parandalimit? Lexoni këtë artikull për të zgjidhur pyetjet tuaja.

A e keni pyetur ndonjëherë veten se si fitojnë para hakerët?

A e keni pyetur ndonjëherë veten se si fitojnë para hakerët?

Ju mund të keni dëgjuar se hakerët fitojnë shumë para, por a keni menduar ndonjëherë se si i fitojnë ato para? Le te diskutojme.

Shpikjet revolucionare nga Google që do tju bëjnë të lehtë jetën tuaj.

Shpikjet revolucionare nga Google që do tju bëjnë të lehtë jetën tuaj.

Dëshironi të shihni shpikjet revolucionare nga Google dhe se si këto shpikje ndryshuan jetën e çdo njeriu sot? Më pas lexoni në blog për të parë shpikjet nga Google.

E Premte Thelbësore: Çfarë ndodhi me Makinat e drejtuara nga AI?

E Premte Thelbësore: Çfarë ndodhi me Makinat e drejtuara nga AI?

Koncepti i makinave vetë-drejtuese për të dalë në rrugë me ndihmën e inteligjencës artificiale është një ëndërr që e kemi prej kohësh. Por, pavarësisht nga disa premtime, ato nuk shihen askund. Lexoni këtë blog për të mësuar më shumë…

Singulariteti teknologjik: Një e ardhme e largët e qytetërimit njerëzor?

Singulariteti teknologjik: Një e ardhme e largët e qytetërimit njerëzor?

Ndërsa Shkenca evoluon me një ritëm të shpejtë, duke marrë përsipër shumë nga përpjekjet tona, rriten edhe rreziqet për t'iu nënshtruar një Singulariteti të pashpjegueshëm. Lexoni, çfarë mund të thotë singulariteti për ne.

Funksionalitetet e shtresave të arkitekturës së referencës së të dhënave të mëdha

Funksionalitetet e shtresave të arkitekturës së referencës së të dhënave të mëdha

Lexoni blogun për të njohur shtresat e ndryshme në arkitekturën e të dhënave të mëdha dhe funksionalitetet e tyre në mënyrën më të thjeshtë.

Evolucioni i ruajtjes së të dhënave - Infografik

Evolucioni i ruajtjes së të dhënave - Infografik

Metodat e ruajtjes së të dhënave kanë evoluar mund të jenë që nga lindja e të dhënave. Ky blog mbulon evolucionin e ruajtjes së të dhënave në bazë të një infografike.

6 Përfitimet e mahnitshme të të pasurit pajisje shtëpiake inteligjente në jetën tonë

6 Përfitimet e mahnitshme të të pasurit pajisje shtëpiake inteligjente në jetën tonë

Në këtë botë të drejtuar nga dixhitali, pajisjet inteligjente të shtëpisë janë bërë një pjesë thelbësore e jetës. Këtu janë disa përfitime të mahnitshme të pajisjeve shtëpiake inteligjente se si ato e bëjnë jetën tonë të vlefshme dhe më të thjeshtë.

Përditësimi shtesë i macOS Catalina 10.15.4 po shkakton më shumë probleme sesa zgjidhja

Përditësimi shtesë i macOS Catalina 10.15.4 po shkakton më shumë probleme sesa zgjidhja

Së fundmi Apple lëshoi ​​macOS Catalina 10.15.4 një përditësim shtesë për të rregulluar problemet, por duket se përditësimi po shkakton më shumë probleme që çojnë në bricking të makinerive mac. Lexoni këtë artikull për të mësuar më shumë