Nodebb with nginx as reverse proxy and LE ssl [ centos 7]
#1
reason for writing this tutorial, I recently tried to install Nodebb on my server , and here is how i did it after hitting many problems.

Need account with root permission

Code:
yum -y update
yum -y install epel-release yum -y update

next install 

Code:
yum -y groupinstall "Development Tools"

yum -y install git redis ImageMagick npm


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


Code:
systemctl start redis.service
systemctl enable redis.service


Install NodeJS using nvm(I installed using nvm)



v6.11.1 is the latest LTS release of NodeJS now

if curl is not installed 
Code:
yum install curl 
Code:
cd
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
source ~/.bash_profile
nvm list-remote
nvm install v6.11.1

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

Once done, run the following command to initialize the setup script and start the installer.
Code:
./nodebb setup



you can chose the default value by pressing enter 


Terminal

URL used to access this NodeBB (http://localhost:4567) [Enter]
Please enter a NodeBB secret (80130768-f722-4d53-a9b8-b2a1edbe11a0) [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 urusername
Administrator email address username@mail.com
Password password
Confirm Password password



The preferred way to start and stop NodeBB is by invoking its executable:

Code:
./nodebb start                    ##Starts the NodeBB server
./nodebb stop                     ##Stops the NodeBB server

Alternatively, you may use npm start and npm stop to do the same

i used the forever package via the command line interface  to keep NodeBB up , which can monitor NodeBB and re-launch it if necessary:


Code:
npm install -g forever
forever start app.js

Configuring nginx with Let's Encrypt SSL

Code:
yum -y install nginx

yum -y install certbot

Code:
certbot certonly --standalone -d yourdomain.com -d www.yourdomain.com

setting up automatic renewal (using crontab), If not installed install cronie
Code:
yum install cronie


Code:
crontab -e 
Enter the following line into the crontab file.
Quote:30 1 * * 1 /usr/bin/certbot renew >> /var/log/le-renew.log

After generating the ssl certificates we will configure nginx

Code:
nano /etc/nginx/conf.d/ssl-yourdomain.com.conf

Replace yourdomain.com with your actual domain. Now copy and paste the following lines into the file.
Quote:server {
    listen 80;
    return 301 https://$host$request_uri;
}server {
        listen 443 http2 ssl;server_name yourdomain.com http://www.yourdomain.com;ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; ssl_ecdh_curve secp384r1; ssl_session_cache sharedHuhSL:10m; ssl_session_tickets off; ssl_stapling on; ssl_stapling_verify on; resolver 8.8.8.8 8.8.4.4 valid=300s; resolver_timeout 5s; add_header Strict-Transport-Security "max-age=63072000; includeSubdomains"; add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://localhost:4567; proxy_read_timeout 90; proxy_redirect http://localhost:4567 https://yourdomain.com; } }

Now start nginx web server and enable it to automatically start at boot time using the following commands.


Code:
systemctl start nginx systemctl enable nginx


Thats it , now you can visit your domain name in your web browser  to login to your forum

also check out the documentation of nodebb
https://nodebb.readthedocs.io/en/latest/

*It is not advised to run nodebb directly with root account*

[Image: 2017_07_28_135638_1280x800_scrot.png]
Fly
#2
Good and easy tutorial, is NodeBB better than MyBB?
I saw a demo and it seems not, Does NodeBB have a old theme suitable for basic mobiles?
Show support by wearing an Avatar or Signature or Custom Rank if you think freevps.us should not be closed.
Code:
[IMG]http://i65.tinypic.com/15z1afs.jpg[/IMG]
#SaveFreeVPS for the future
#3
(2017-07-28, 11:46:12 am)LittleMaster Wrote:  Good and easy tutorial, is NodeBB better than MyBB?
I saw a demo and it seems not, Does NodeBB have a old theme suitable for basic mobiles?

I think it's much better, MyBB is outdated
#4
NodeBB is worst, slowest piece of software i have ever used. Even discourse and flarum which is still in beta loads faster and works better
#5
(2017-07-31, 7:24:23 am)Kururin Wrote:  NodeBB is worst, slowest piece of software i have ever used. Even discourse and flarum which is still in beta loads faster and works better

really? It works completely perfectly for me only the first time I load the website is slow.
Thank you FuzzyHosts and FreeVPS for my VPS 2! rip fuzzyhosts Sad

#6
(2017-07-31, 7:24:23 am)Kururin Wrote:  NodeBB is worst, slowest piece of software i have ever used. Even discourse and flarum which is still in beta loads faster and works better

discourse fast? are you kidding me discourse was most slow forum software i tried till now specifically 1st loading after that its good but still slow. nodebb is much faster even in 1st load. and yeah flarum is definitely a great software but infinite time in beta :p
#7
(2017-07-31, 5:03:34 pm)Zubair Wrote:  discourse fast? are you kidding me discourse was most slow forum software i tried till now specifically 1st loading after that its good but still slow. nodebb is much faster even in 1st load. and yeah flarum is definitely a great software but infinite time in beta :p

Of course discourse will be s-it if you run it in a low ram environment, i ran it in 2 gb ram and its loads fast as it should be. Flarum tho beats the s-it out of discourse except the visual that discourse shines at (cough)
#8
(2017-08-04, 2:12:28 pm)Kururin Wrote:  Of course discourse will be s-it if you run it in a low ram environment, i ran it in 2 gb ram and its loads fast as it should be. Flarum tho beats the s-it out of discourse except the visual that discourse shines at (cough)
i tried it on 4gb ram :p because my host doesn't allow swap and discourse atleast need 4gb (2gb ram + 2 gb swap) but i used development tutorial (without docker one) maybe that was the reason of heaviness. discourse admin panel sucks nodebb has much better backend panel and yeah flarum still in beta so can't say much.
#9
(2017-07-28, 11:46:12 am)LittleMaster Wrote:  Good and easy tutorial, is NodeBB better than MyBB?
I saw a demo and it seems not, Does NodeBB have a old theme suitable for basic mobiles?

The default theme is built on Bootstrap, which is by default mobile compatible.

(2017-07-31, 7:24:23 am)Kururin Wrote:  NodeBB is worst, slowest piece of software i have ever used. Even discourse and flarum which is still in beta loads faster and works better

NodeBB has been really fast for me (as for the others). Additionally, all of these softwares are built on different platforms - NodeBB Is built on NodeJS, Discord on Ruby, and Flarum on PHP.
-karatekidmonkey (https://codeco.pw)
Thanks to ZXPlay for my VPS!
http://www.islc.eu.org/fvps/index.php?userid=17742

natcp-verify-token-17742


Recheck




Users browsing this thread: 1 Guest(s)