Welcome to Centmin Mod Community
Register Now

NodeBB Centmin Mod Nginx + NodeBB Forum Install

Discussion in 'Forum software usage' started by eva2000, Aug 1, 2015.

  1. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    8:17 PM
    Nginx 1.13.x
    MariaDB 5.5
    With Centmin Mod 1.2.3-eva2000.08 stable release out now, it's time to revisit NodeBB install and setup. NodeBB is a node.js based open source forum software which can use either Redis or MongoDB for backend database. NodeBB official support forums are at https://community.nodebb.org/.

    Note:
    1. The following is a guide on installing NodeBB on Centmin Mod LEMP stack only. Learning how to use NodeBB is left up to you so best to signup on official NodeBB support forums as well as check out NodeBB's Github Repo and NodeBB Documentation ;)
    2. NodeBB Upgrade documentation
    3. Scaling NodeBB documentation
    4. Admin functions documentation
    5. Social Network SSOs docmentation
    6. Image API for storaging uploads in Amazon S3
    7. I posted a redisinfo.sh script on NodeBB forums ages back that might be useful along with some Redis information.

    NodeBB Install on Centmin Mod LEMP stack



    These instructions follow the official NodeBB documentation for CentOS install.

    To install NodeBB forums on Centmin Mod LEMP stack, you first need to install all the required software including Node.js and Redis at least.

    For Centmin Mod 123.08stable

    Centmin Mod has an Phusion Passenger Addon which installs Phusion Passenger required software which includes npm, Node.js, Ruby, Rubygems, Rails so running that addon would take care of the requirements first. Centmin Mod already has installed git and ImageMagick required packages.

    Phusion Passenger for node.js requirements

    Run Phusion Passenger Addon from Centmin Mod install directory's addons/passenger.sh directory. The cmdir shortcut alias will change you to Centmin Mod install directory at /usr/local/src/centminmod.

    Code (Text):
    cmdir
    cd addons
    ./passenger.sh install


    For Centmin Mod 123.09beta01 and higher

    Centmin Mod 123.09beta01 as at Jan 20th, 2016 has added a standalone addons/nodejs.sh installer so no longer need to run addons/passenger.sh addon to install node.js

    Code (Text):
    cmdir
    cd addons
    ./nodejs.sh install


    Redis for database usage

    Install Redis server via YUM. Centmin Mod's 3rd party YUM repos will take care of this by using Remi YUM repo for Redis 3.x.

    Code (Text):
    yum -y install redis --enablerepo=remi --disableplugin=priorities
    chkconfig --add redis
    chkconfig --level 345 redis on
    service redis start


    Optionally setup Redis password
    Code (Text):
    REDISPASS=$(openssl rand 10 -base64)
    echo "requirepass $REDISPASS" >> /etc/redis.conf
    service redis restart


    Create Site Domain Nginx Vhost

    Setup the domain Nginx vhost where you want NodeBB installed on i.e. newdomain.com. You can follow Getting Started Item 2 or the Nginx vhost setup guide page.

    I will use the new /usr/bin/nv command line method for adding newdomain.com Nginx vhost

    Code (Text):
    /usr/bin/nv -d newdomain.com -s y -u MYFTPUSERNAME


    Then install via git clone the NodeBB files into the web root public directory i.e. /home/nginx/domains/newdomain.com/public/nodebb/. Latest version of NodeBB on Github is v1.4.5

    Code (Text):
    cd /home/nginx/domains/newdomain.com/public
    git clone -b v1.4.5 https://github.com/NodeBB/NodeBB nodebb
    


    Then change into directory and run npm install and nodebb setup/start
    Code (Text):
    cd /home/nginx/domains/newdomain.com/public/nodebb
    npm install
    ./nodebb setup
    

    As NodeBB was setup on /nodebb subdirectory edit /home/nginx/domains/newdomain.com/public/nodebb/config.json to tag on the end /nodebb from docs at The NodeBB Config (config.json) — NodeBB 0.4.1 documentation

    change url from (might say localhost which you can change to 127.0.0.1
    Code:
    http://127.0.0.1:4567
    to
    Code:
    http://127.0.0.1:4567/nodebb


    i.e. /home/nginx/domains/newdomain.com/public/nodebb/config.json

    Code (Text):
    {
        "url": "http://127.0.0.1:4567",
        "secret": "09df113d-0255-48b7-8e21-csssss2224",
        "database": "redis",
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": "",
            "database": "3"
        }
    }


    Then start nodebb via
    Code (Text):
    cd /home/nginx/domains/newdomain.com/public/nodebb
    ./nodebb start


    Then you can start and stop node.js via

    To start

    Code (Text):
    cd /home/nginx/domains/newdomain.com/public/nodebb/; ./nodebb start


    To stop

    Code (Text):
    cd /home/nginx/domains/newdomain.com/public/nodebb/; ./nodebb stop


    To restart

    Code (Text):
    cd /home/nginx/domains/newdomain.com/public/nodebb/; ./nodebb restart


    To view log output

    Code (Text):
    cd /home/nginx/domains/newdomain.com/public/nodebb/; ./nodebb log


    Also you can add alias commands to /root/.bashrc as well
    • nodebbstart = to start
    • nodebbstop = to stop
    • nodebbrestart = to restart
    • nodebblog = to view log

    Code (Text):
    alias nodebbstart='cd /home/nginx/domains/newdomain.com/public/nodebb/; ./nodebb start'
    alias nodebbstop='cd /home/nginx/domains/newdomain.com/public/nodebb/; ./nodebb stop'
    alias nodebbrestart='cd /home/nginx/domains/newdomain.com/public/nodebb/; ./nodebb restart'
    alias nodebblog='cd /home/nginx/domains/newdomain.com/public/nodebb/; ./nodebb log'


    NodeBB Nginx Vhost Setup



    Then to setup Nginx vhost for newdomain.com to be able to use Nginx to proxy the NodeBB installation on port 4567. If you setup newdomain.com via centmin.sh menu option 2 or via /usr/bin/nv with SSL enabled you would have 2 Nginx vhost files to edit.
    • for http at /usr/local/nginx/conf/conf.d/newdomain.com.conf
    • for https SPDY SSL at /usr/local/nginx/conf/conf.d/newdomain.com..ssl.conf

    Also comment out /usr/local/nginx/conf/staticfiles.conf include line inboth vhost files
    Code (Text):
      include /usr/local/nginx/conf/staticfiles.conf;


    The relevant NodeBB proxy info for Nginx vhost. Save this info into a file called /home/nginx/domains/newdomain.com/include-nodebb.conf

    Code (Text):
        location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) {
            root /home/nginx/domains/newdomain.com/public/nodebb/public;
        }
    
        location / {
            root /home/nginx/domains/newdomain.com/public/nodebb/public;
            proxy_pass http://127.0.0.1:4567;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    
    


    Add the file as an include file in both /usr/local/nginx/conf/conf.d/newdomain.com.conf and /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf

    So in /usr/local/nginx/conf/conf.d/newdomain.com.conf

    Code (Text):
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name newdomain.com;
    #            return 301 $scheme://www.newdomain.com$request_uri;
    #       }
    
    server {
      server_name newdomain.com www.newdomain.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/newdomain.com/log/access.log combined buffer=256k flush=60m;
      error_log /home/nginx/domains/newdomain.com/log/error.log;
    
      root /home/nginx/domains/newdomain.com/public;
    
      include /home/nginx/domains/newdomain.com/include-nodebb.conf;
    
    #  include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    


    In /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf

    Code (Text):
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For SPDY SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from www to non-www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    # server {
    #   server_name newdomain.com www.newdomain.com;
    #    return 302 https://$server_name$request_uri;
    # }
    
    server {
      listen 443 ssl http2;
      server_name newdomain.com www.newdomain.com;
    
      ssl_dhparam /usr/local/nginx/conf/ssl/newdomain.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.crt;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.key;
      include /usr/local/nginx/conf/ssl_include.conf;
    
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      # mozilla recommended
      ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+ECDSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+SHA384:EECDH+AES128:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!CAMELLIA;
      ssl_prefer_server_ciphers   on;
      #add_header Alternate-Protocol  443:npn-spdy/3;
    
      # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts
      #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
      #spdy_headers_comp 5;
      ssl_buffer_size 1369;
      ssl_session_tickets on;
    
      # enable ocsp stapling
      #resolver 8.8.8.8 8.8.4.4 valid=10m;
      #resolver_timeout 10s;
      #ssl_stapling on;
      #ssl_stapling_verify on;
      #ssl_trusted_certificate /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com-trusted.crt;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/newdomain.com/log/access.log combined buffer=256k flush=60m;
      error_log /home/nginx/domains/newdomain.com/log/error.log;
    
      root /home/nginx/domains/newdomain.com/public;
    
      include /home/nginx/domains/newdomain.com/include-nodebb.conf;
    
    #  include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }


    NodeBB Scaling



    To scale Nodebb as per Scaling NodeBB — NodeBB 1.x documentation, edit config.json and add this line
    Code (Text):
        "port": ["4567", "4568", "4569"],
    

    so it becomes
    Code (Text):
    {
        "url": "http://newdomain.com:4567",
        "secret": "ec8d3716-e398-4e59-9c6b-666292e7b4ad",
        "database": "redis",
        "port": ["4567", "4568", "4569"],
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": "",
            "database": "9"
        }
    }

    then restart nodebb
    Code (Text):
    cd /home/nginx/domains/newdomain.com/public/nodebb
    ./nodebb restart
    

    Code (Text):
        "port": ["4567", "4568", "4569"],
    

    verify 3 node.js instances are listening on ports 4567, 4568, 4569
    Code (Text):
    netstat -lnpt | grep 45
    tcp        0      0 0.0.0.0:4567            0.0.0.0:*               LISTEN      7460/node         
    tcp        0      0 0.0.0.0:4568            0.0.0.0:*               LISTEN      7466/node         
    tcp        0      0 0.0.0.0:4569            0.0.0.0:*               LISTEN      7472/node
    

    add to your nginx vhost i.e. /usr/local/nginx/conf/conf.d/newdomain.com.conf above server {} context
    Code (Text):
    upstream io_nodes {
       ip_hash;
       server 127.0.0.1:4567;
       server 127.0.0.1:4568;
       server 127.0.0.1:4569;
    }
    

    edit /home/nginx/domains/newdomain.com/include-nodebb.conf and change proxy_pass setting from
    Code (Text):
    proxy_pass http://127.0.0.1:4567;
    

    to
    Code (Text):
    proxy_pass http://io_nodes;
    

    restart nginx
    Code (Text):
    ngxrestart
    

    updated contents of /home/nginx/domains/newdomain.com/include-nodebb.conf
    Code (Text):
        location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) {
            root /home/nginx/domains/newdomain.com/public/nodebb/public;
        }
    
        location / {
            root /home/nginx/domains/newdomain.com/public/nodebb/public;
    #        proxy_pass http://127.0.0.1:4567;
            proxy_pass http://io_nodes;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    
     
    Last edited: Apr 7, 2017
    • Informative Informative x 2
  2. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    8:17 PM
    Nginx 1.13.x
    MariaDB 5.5
    Example Phusion Passenger Addon install output near the end of the script's completion. It will also post the version info for software installed.

    Code:
    cmdir
    cd addons
    ./passenger.sh install
    Code:
    Install of ruby-2.2.2 - #complete
    Ruby was built without documentation, to build it run: rvm docs generate-ri
    --------------------------------
    Using /usr/local/rvm/gems/ruby-2.2.2
    --------------------------------
    PATH echo...
    --------------------------------
    Rubygems 2.4.8 already available in installed ruby, skipping installation, use --force to reinstall.
    --------------------------------
    RubyGems Environment:
      - RUBYGEMS VERSION: 2.4.8
      - RUBY VERSION: 2.2.2 (2015-04-13 patchlevel 95) [x86_64-linux]
      - INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-2.2.2
      - RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-2.2.2/bin/ruby
      - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-2.2.2/bin
      - SPEC CACHE DIRECTORY: /root/.gem/specs
      - SYSTEM CONFIGURATION DIRECTORY: /usr/local/rvm/rubies/ruby-2.2.2/etc
      - RUBYGEMS PLATFORMS:
        - ruby
        - x86_64-linux
      - GEM PATHS:
         - /usr/local/rvm/gems/ruby-2.2.2
         - /usr/local/rvm/gems/ruby-2.2.2@global
      - GEM CONFIGURATION:
         - :update_sources => true
         - :verbose => true
         - :backtrace => false
         - :bulk_threshold => 1000
      - REMOTE SOURCES:
         - https://rubygems.org/
      - SHELL PATH:
         - /usr/local/rvm/gems/ruby-2.2.2/bin
         - /usr/local/rvm/gems/ruby-2.2.2@global/bin
         - /usr/local/rvm/rubies/ruby-2.2.2/bin
         - /usr/local/rvm/bin
         - /usr/lib64/ccache
         - /usr/local/sbin
         - /usr/local/bin
         - /usr/sbin
         - /usr/bin
         - /root/bin
         - /root/bin
    --------------------------------
    Successfully installed rake-10.4.2
    Successfully installed thread_safe-0.3.5
    Successfully installed tzinfo-1.2.2
    Successfully installed i18n-0.7.0
    Successfully installed activesupport-4.2.3
    Successfully installed rails-deprecated_sanitizer-1.0.3
    Successfully installed mini_portile-0.6.2
    Building native extensions.  This could take a while...
    Successfully installed nokogiri-1.6.6.2
    Successfully installed rails-dom-testing-1.0.6
    Successfully installed loofah-2.0.2
    Successfully installed rails-html-sanitizer-1.0.2
    Successfully installed erubis-2.7.0
    Successfully installed builder-3.2.2
    Successfully installed actionview-4.2.3
    Successfully installed rack-1.6.4
    Successfully installed rack-test-0.6.3
    Successfully installed actionpack-4.2.3
    Successfully installed sprockets-3.2.0
    Successfully installed sprockets-rails-2.3.2
    Successfully installed bundler-1.10.6
    Successfully installed thor-0.19.1
    Successfully installed railties-4.2.3
    Successfully installed globalid-0.3.5
    Successfully installed activejob-4.2.3
    Successfully installed mime-types-2.6.1
    Successfully installed mail-2.6.3
    Successfully installed actionmailer-4.2.3
    Successfully installed arel-6.0.2
    Successfully installed activemodel-4.2.3
    Successfully installed activerecord-4.2.3
    Successfully installed rails-4.2.3
    Building native extensions.  This could take a while...
    Successfully installed sqlite3-1.3.10
    Building native extensions.  This could take a while...
    Successfully installed mysql-2.9.1
    33 gems installed
    Building native extensions.  This could take a while...
    Successfully installed passenger-5.0.15
    1 gem installed
    --------------------------------
    more checks...
    --------------------------------
    ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
    --------------------------------
    Rails 4.2.3
    --------------------------------
    Phusion Passenger version 5.0.15
    --------------------------------
    *** WARNING: The Apache executable cannot be found.
    Please set the APXS2 environment variable to your 'apxs2' executable's filename, or set the HTTPD environment variable to your 'httpd' or 'apache2' executable's filename.
    Version: 5.0.15
    Date   : 2015-08-01 09:18:42 +0000
    ------------- Apache processes -------------
    
    
    --------- Nginx processes ----------
    PID   PPID  VMSize    Private  Name
    ------------------------------------
    2503  1     173.5 MB  2.8 MB   nginx: master process /usr/local/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
    2504  2503  181.5 MB  4.9 MB   nginx: worker process
    2505  2503  181.5 MB  4.9 MB   nginx: worker process
    ### Processes: 3
    ### Total private dirty RSS: 12.57 MB
    
    
    --- Passenger processes ---
    ### Processes: 0
    ### Total private dirty RSS: 0.00 MB
    --------------------------------
    --------------------------------
    actionmailer (4.2.3)
    actionpack (4.2.3)
    actionview (4.2.3)
    activejob (4.2.3)
    activemodel (4.2.3)
    activerecord (4.2.3)
    activesupport (4.2.3)
    arel (6.0.2)
    bigdecimal (1.2.6)
    builder (3.2.2)
    bundler (1.10.6)
    bundler-unload (1.0.2)
    erubis (2.7.0)
    executable-hooks (1.3.2)
    gem-wrappers (1.2.7)
    globalid (0.3.5)
    i18n (0.7.0)
    io-console (0.4.3)
    json (1.8.1)
    loofah (2.0.2)
    mail (2.6.3)
    mime-types (2.6.1)
    mini_portile (0.6.2)
    minitest (5.4.3)
    mysql (2.9.1)
    nokogiri (1.6.6.2)
    passenger (5.0.15)
    power_assert (0.2.2)
    psych (2.0.8)
    rack (1.6.4)
    rack-test (0.6.3)
    rails (4.2.3)
    rails-deprecated_sanitizer (1.0.3)
    rails-dom-testing (1.0.6)
    rails-html-sanitizer (1.0.2)
    railties (4.2.3)
    rake (10.4.2)
    rdoc (4.2.0)
    rubygems-bundler (1.4.4)
    rvm (1.11.3.9)
    sprockets (3.2.0)
    sprockets-rails (2.3.2)
    sqlite3 (1.3.10)
    test-unit (3.0.8)
    thor (0.19.1)
    thread_safe (0.3.5)
    tzinfo (1.2.2)
    --------------------------------
    -------------------------------------------
    Setup /usr/local/nginx/conf/passenger.conf
    -------------------------------------------
    Passenger root located at: /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.0.15
    -------------------------------------------
    Setup completed...
    -------------------------------------------
    
    Log out and log back into your SSH session
    to complete the next setup steps bellow
    
    Instructions also at https://community.centminmod.com/threads/3282
    
    Uncomment lines in /usr/local/nginx/conf/passenger.conf to enable passenger
    Nginx needs to have passenger nginx module compiled for it to work
    
    1. edit centmin.sh and set NGINX_PASSENGER=y
    2. run centmin.sh menu option 4 to recompile Nginx
    3. uncomment/enable /usr/local/nginx/conf/passenger.conf include file in nginx.conf
    4. then check that passenger module is in list of nginx modules via command:
    
    nginx -V
    
    
    This script only installs passenger, node.js, ruby, rails, rubygem and is provided as is.
    See Phusion Passenger documentation at for deployment and configuration at:
    * http://www.modrails.com/documentation/Users%20guide%20Nginx.html
    * https://github.com/phusion/passenger/wiki/Phusion-Passenger%3A-Node.js-tutorial
    * https://github.com/phusion/passenger/wiki
    
    Log out and log back into your SSH session
    to complete the next setup steps above
    
    Instructions also at https://community.centminmod.com/threads/3282
    The Nginx Passenger setup instructions are not needed for NodeBB unless you want to enable Phusion Passenger Nginx module support in Nginx.
     
    Last edited: Aug 1, 2015
  3. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    8:17 PM
    Nginx 1.13.x
    MariaDB 5.5
    Example output for Nginx vhost setup for newdomain.com

    Replace MYFTPUSERNAME with your desired Pure-FTPD virtual FTP username.

    Code:
    /usr/bin/nv -d newdomain.com -s y -u MYFTPUSERNAME
    ---------------------------------------------------------------
    Nginx Vhost Setup...
    ---------------------------------------------------------------
    
    FTP password auto generated: vj12PDwTxUluMQLwwlGU6
    
    Password:
    Enter it again:
    ---------------------------------------------------------------
    SSL Vhost Setup...
    ---------------------------------------------------------------
    
    ---------------------------------------------------------------
    Generating self signed SSL certificate...
    Generating a 2048 bit RSA private key
    ...................+++
    .....................................................+++
    writing new private key to 'newdomain.com.key'
    -----
    Signature ok
    subject=/C=US/ST=California/L=Los Angeles/O=newdomain.com/CN=newdomain.com
    Getting Private key
    ---------------------------------------------------------------
    Generating dhparam.pem file - can take a few minutes...
    Generating DH parameters, 2048 bit long safe prime, generator 2
    This is going to take a long time
    ................+.+...............................+...........................................+.................................++*++*
    dhparam file generation time: 184.969459161
    
    -------------------------------------------------------------
    Restarting nginx (via systemctl):                          [  OK  ]
    systemctl restart pure-ftpd.service
    
    -------------------------------------------------------------
    FTP hostname : SERVERIPADDRESS
    FTP port : 21
    FTP mode : FTP (explicit SSL)
    FTP Passive (PASV) : ensure is checked/enabled
    FTP username created for newdomain.com : MYFTPUSERNAME
    FTP password created for newdomain.com : vj12PDwTxUluMQLwwlGU6
    -------------------------------------------------------------
    vhost for newdomain.com created successfully
    
    domain: http://newdomain.com
    vhost conf file for newdomain.com created: /usr/local/nginx/conf/conf.d/newdomain.com.conf
    
    vhost ssl for newdomain.com created successfully
    
    domain: https://newdomain.com
    vhost ssl conf file for newdomain.com created: /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf
    /usr/local/nginx/conf/ssl_include.conf created
    Self-signed SSL Certificate: /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.crt
    SSL Private Key: /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.key
    SSL CSR File: /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.csr
    
    upload files to /home/nginx/domains/newdomain.com/public
    vhost log files directory is /home/nginx/domains/newdomain.com/log
    
    -------------------------------------------------------------
    Current vhost listing at: /usr/local/nginx/conf/conf.d/
    
                          
    Jul 27  20:17   845    ssl.conf
    Jul 27  20:17   1.1K   demodomain.com.conf
    Jul 27  20:23   1.6K   virtual.conf
    Aug 1   09:29   1.6K   newdomain.com.conf
    Aug 1   09:29   3.3K   newdomain.com.ssl.conf
    
    -------------------------------------------------------------
    Current vhost ssl files listing at: /usr/local/nginx/conf/ssl/newdomain.com
    
                          
    Aug 1   09:26   1.7K   newdomain.com.key
    Aug 1   09:26   1005   newdomain.com.csr
    Aug 1   09:26   1.2K   newdomain.com.crt
    Aug 1   09:29   424    dhparam.pem
    
    -------------------------------------------------------------
    Commands to remove newdomain.com
    
    rm -rf /usr/local/nginx/conf/conf.d/newdomain.com.conf
    rm -rf /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf
    rm -rf /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.crt
    rm -rf /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.key
    rm -rf /usr/local/nginx/conf/ssl/newdomain.com/newdomain.com.csr
    rm -rf /home/nginx/domains/newdomain.com
    service nginx restart
    -------------------------------------------------------------
    
     
    Last edited: Aug 1, 2015
  4. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    8:17 PM
    Nginx 1.13.x
    MariaDB 5.5
    Example for git clone download of NodeBB files

    Code:
    cd /home/nginx/domains/newdomain.com/public
    git clone -b v0.7.x https://github.com/NodeBB/NodeBB nodebb
    Cloning into 'nodebb'...
    remote: Counting objects: 78015, done.
    remote: Compressing objects: 100% (5/5), done.
    remote: Total 78015 (delta 0), reused 0 (delta 0), pack-reused 78010
    Receiving objects: 100% (78015/78015), 24.23 MiB | 2.66 MiB/s, done.
    Resolving deltas: 100% (56269/56269), done.
    Note: checking out '56b79a974a986fd43452959cea61cba3b5a80f4d'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by performing another checkout.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -b with the checkout command again. Example:
    
      git checkout -b new_branch_name
    Checking all branches and which branch you're on right now
    Code:
    cd nodebb/
    git branch -a
    * (no branch)
      remotes/origin/ACP
      remotes/origin/ACP2
      remotes/origin/HEAD -> origin/master
      remotes/origin/ajaxify-cache
      remotes/origin/ajaxify-render
      remotes/origin/categories_revamp
      remotes/origin/composer-mobile
      remotes/origin/composer-redesign
      remotes/origin/disney
      remotes/origin/group-manage-revamp
      remotes/origin/grunt-dev
      remotes/origin/master
      remotes/origin/omgbower
      remotes/origin/persona
      remotes/origin/require.js
      remotes/origin/rewards
      remotes/origin/secondary_database
      remotes/origin/seekrit
      remotes/origin/sortable-menu
      remotes/origin/topic-priv-refactor
      remotes/origin/upstart-compat
      remotes/origin/v0.1.x
      remotes/origin/v0.2.x
      remotes/origin/v0.3.x
      remotes/origin/v0.4.x
      remotes/origin/v0.5.x
      remotes/origin/v0.6.x
      remotes/origin/v0.7.x
      remotes/origin/v0.8.x
      remotes/origin/web-install
      remotes/origin/webworkers
    Personally, I checkout my own branch i.e. my-0.7.2
    Code:
    git checkout -b my-0.7.2
    Switched to a new branch 'my-0.7.2'
    Code:
    git branch -a         
    * my-0.7.2
      remotes/origin/ACP
      remotes/origin/ACP2
      remotes/origin/HEAD -> origin/master
      remotes/origin/ajaxify-cache
      remotes/origin/ajaxify-render
      remotes/origin/categories_revamp
      remotes/origin/composer-mobile
      remotes/origin/composer-redesign
      remotes/origin/disney
      remotes/origin/group-manage-revamp
      remotes/origin/grunt-dev
      remotes/origin/master
      remotes/origin/omgbower
      remotes/origin/persona
      remotes/origin/require.js
      remotes/origin/rewards
      remotes/origin/secondary_database
      remotes/origin/seekrit
      remotes/origin/sortable-menu
      remotes/origin/topic-priv-refactor
      remotes/origin/upstart-compat
      remotes/origin/v0.1.x
      remotes/origin/v0.2.x
      remotes/origin/v0.3.x
      remotes/origin/v0.4.x
      remotes/origin/v0.5.x
      remotes/origin/v0.6.x
      remotes/origin/v0.7.x
      remotes/origin/v0.8.x
      remotes/origin/web-install
      remotes/origin/webworkers
     
    Last edited: Aug 2, 2015
  5. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    8:17 PM
    Nginx 1.13.x
    MariaDB 5.5
    Code:
        ./nodebb setup
        1/8 09:58 [5915] - info: NodeBB Setup Triggered via Command Line
    
        Welcome to NodeBB!
    
        This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed.
        Press enter to accept the default setting (shown in brackets).
        URL used to access this NodeBB (http://localhost:4567)
        Please enter a NodeBB secret (09df113d-0255-48b7-8e21-c2d0eba3be54)
        Which database to use (redis)
    
        1/8 09:58 [5915] - info: Now configuring redis database:
        Host IP or address of your Redis instance (127.0.0.1)
        Host port of your Redis instance (6379)
        Password of your Redis database
        Which database to use (0..n) (0) 3
        Configuration Saved OK
        redis@0.10.3 node_modules/redis
    
        connect-redis@2.0.0 node_modules/connect-redis
        └── debug@2.2.0 (ms@0.7.1)
        Populating database with default configs, if not already set...
        Enabling default theme: Persona
        No categories found, populating instance with default categories
        1/8 09:59 [5915] - warn: No administrators have been detected, running initial user setup
    Example npm install and setup

    The npm install can take quite a long time it seems and is quite length so posted a gist for npm install output here..

    Directory contents of NodeBB install directory at /home/nginx/domains/newdomain.com/public/nodebb/

    Code:
    ls -lah /home/nginx/domains/newdomain.com/public/nodebb/
    total 284K
    drwxr-sr-x 10 root  nginx 4.0K Aug  1 09:44 .
    drwxr-s---  3 nginx nginx 4.0K Aug  1 09:39 ..
    -rw-r--r--  1 root  nginx  13K Aug  1 09:40 app.js
    -rw-r--r--  1 root  nginx  662 Aug  1 09:40 bcrypt.js
    -rw-r--r--  1 root  nginx 3.4K Aug  1 09:40 CONTRIBUTING.md
    -rw-r--r--  1 root  nginx  157 Aug  1 09:40 .editorconfig
    drwxr-sr-x  8 root  nginx  152 Aug  1 09:43 .git
    -rw-r--r--  1 root  nginx  257 Aug  1 09:40 .gitattributes
    -rw-r--r--  1 root  nginx  625 Aug  1 09:40 .gitignore
    -rw-r--r--  1 root  nginx 2.1K Aug  1 09:40 Gruntfile.js
    drwxr-sr-x  3 root  nginx   49 Aug  1 09:40 install
    -rw-r--r--  1 root  nginx  455 Aug  1 09:40 .jsbeautifyrc
    -rw-r--r--  1 root  nginx 5.2K Aug  1 09:40 .jshintrc
    -rw-r--r--  1 root  nginx  35K Aug  1 09:40 LICENSE
    -rw-r--r--  1 root  nginx 6.5K Aug  1 09:40 loader.js
    drwxr-sr-x  2 root  nginx   23 Aug  1 09:40 logs
    -rw-r--r--  1 root  nginx 1.8K Aug  1 09:40 minifier.js
    -rwxr-xr-x  1 root  nginx 5.1K Aug  1 09:40 nodebb
    -rw-r--r--  1 root  nginx 2.4K Aug  1 09:40 nodebb.bat
    drwxr-sr-x 68 root  root  4.0K Aug  1 09:45 node_modules
    -rw-r--r--  1 root  nginx 135K Aug  1 09:40 npm-shrinkwrap.json
    -rw-r--r--  1 root  nginx 2.8K Aug  1 09:40 package.json
    drwxr-sr-x  8 root  nginx  115 Aug  1 09:40 public
    -rw-r--r--  1 root  nginx 5.1K Aug  1 09:40 README.md
    drwxr-sr-x 19 root  nginx 4.0K Aug  1 09:40 src
    drwxr-sr-x  4 root  nginx 4.0K Aug  1 09:40 tests
    -rw-r--r--  1 root  nginx 1.1K Aug  1 09:40 .travis.yml
    drwxr-sr-x  2 root  nginx   19 Aug  1 09:40 .tx
    The /home/nginx/domains/newdomain.com/public/nodebb/public public files
    Code:
    ls -lah /home/nginx/domains/newdomain.com/public/nodebb/public
    total 860K
    drwxr-sr-x 10 root nginx 4.0K Aug  1 10:28 .
    drwxr-sr-x 10 root nginx 4.0K Aug  1 10:28 ..
    -rw-r--r--  1 root nginx 183K Aug  1 10:28 admin.css
    -rw-r--r--  1 root nginx 1.2K Aug  1 09:40 favicon.ico
    drwxr-sr-x  3 root nginx   58 Aug  1 09:40 images
    drwxr-sr-x 40 root nginx 4.0K Aug  1 09:40 language
    drwxr-sr-x  3 root nginx   75 Aug  1 09:40 less
    -rw-r--r--  1 root nginx 3.1K Aug  1 09:40 logo.png
    -rw-r--r--  1 root nginx 410K Aug  1 10:28 nodebb.min.js
    drwxr-sr-x  2 root nginx   78 Aug  1 10:28 sounds
    drwxr-sr-x  6 root nginx 4.0K Aug  1 09:40 src
    -rw-r--r--  1 root nginx 232K Aug  1 10:28 stylesheet.css
    drwxr-sr-x 10 root nginx 4.0K Aug  1 10:28 templates
    drwxr-sr-x  6 root nginx   60 Aug  1 09:40 uploads
    drwxr-sr-x 18 root nginx 4.0K Aug  1 09:40 vendor
    run nodebb setup from NodeBB install directory

    Code:
        cd /home/nginx/domains/newdomain.com/public/nodebb/
        ./nodebb setup
        1/8 09:58 [5915] - info: NodeBB Setup Triggered via Command Line
    
        Welcome to NodeBB!
    
        This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed.
        Press enter to accept the default setting (shown in brackets).
        URL used to access this NodeBB (http://localhost:4567)
        Please enter a NodeBB secret (09df113d-0255-48b7-8e21-c2d0eba3be54)
        Which database to use (redis)
    
        1/8 09:58 [5915] - info: Now configuring redis database:
        Host IP or address of your Redis instance (127.0.0.1)
        Host port of your Redis instance (6379)
        Password of your Redis database
        Which database to use (0..n) (0) 3
        Configuration Saved OK
        redis@0.10.3 node_modules/redis
    
        connect-redis@2.0.0 node_modules/connect-redis
        └── debug@2.2.0 (ms@0.7.1)
        Populating database with default configs, if not already set...
        Enabling default theme: Persona
        No categories found, populating instance with default categories
        1/8 09:59 [5915] - warn: No administrators have been detected, running initial user setup
    
    Administrator username eva2000
    Administrator email address myemail@newdomain.com
    Password
    Confirm Password
    Enabling default plugins
    1/8 10:01 [5915] - info: Beginning database schema update
    1/8 10:01 [5915] - info: [2015/02/08] Clearing reset tokens skipped
    1/8 10:01 [5915] - info: [2015/02/17] renaming home.tpl to categories.tpl skipped
    1/8 10:01 [5915] - info: [2015/2/23] Activating NodeBB Essential Rewards - skipped
    1/8 10:01 [5915] - info: [2015/02/24] Upgrading plugins:active to sorted set skipped
    1/8 10:01 [5915] - info: [2015/02/24] Upgrading privilege groups to system groups skipped
    1/8 10:01 [5915] - info: [2015/02/25] Upgrading menu items to dynamic navigation system skipped
    1/8 10:01 [5915] - info: [2015/05/07] Upgrading uid mappings to sorted set skipped
    1/8 10:01 [5915] - info: [2015/05/08] Fixing emails skipped
    1/8 10:01 [5915] - info: [2015/05/11] Updating widgets to tjs 0.2x skipped
    1/8 10:01 [5915] - info: [2015/05/20] Adding username:sorted and email:sorted skipped
    1/8 10:01 [5915] - info: [2015/06/02] Creating group sorted sets skipped
    1/8 10:01 [5915] - info: [2015/07/03] Enabling default composer plugin skipped
    1/8 10:01 [5915] - info: [upgrade] Schema already up to date!
    
         ================================================================================================================================================================================================================================================
    
    NodeBB Setup Completed. Run './nodebb start' to manually start your NodeBB server.
    
    As NodeBB was setup on /nodebb subdirectory edit /home/nginx/domains/newdomain.com/public/nodebb/config.json to tag on the end /nodebb from docs at The NodeBB Config (config.json) — NodeBB 0.4.1 documentation

    change url from
    Code:
    http://127.0.0.1:4567
    to
    Code:
    http://127.0.0.1:4567/nodebb
    i.e. /home/nginx/domains/newdomain.com/public/nodebb/config.json

    Code:
    {
        "url": "http://localhost:4567",
        "secret": "09df113d-0255-48b7-8e21-c2d0eba3be54",
        "database": "redis",
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": "",
            "database": "3"
        }
    }
    Then start node.js and NodeBB via forever

    Code:
    cd /home/nginx/domains/newdomain.com/public/nodebb/; forever start loader.js
     
    Last edited: Aug 1, 2015
  6. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    8:17 PM
    Nginx 1.13.x
    MariaDB 5.5
    Screenshots for frontend and backend admin area

    nodebb-072-index-00.png
    nodebb-072-thread-00.png

    nodebb-072-admin-00.png
    nodebb-072-admin-01.png
    nodebb-072-admin-02.png
    nodebb-072-admin-03.png
    nodebb-072-admin-04.png
     
    Last edited: Aug 2, 2015
    • Like Like x 1
  7. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    8:17 PM
    Nginx 1.13.x
    MariaDB 5.5
    Only problems I have with right now is forever restart or ./nodebb restart commands do not work properly

    Code:
    forever restart loader.js
    info:    Forever restarted process(es):
    data:        uid  command             script    forever pid  id logfile                 uptime 
    data:    [0] n8Gn /usr/local/bin/node loader.js 6554    6559    /root/.forever/n8Gn.log STOPPED
    
    forever stop loader.js       
    error:   Forever cannot find process with id: loader.js
    nodebb restart returns blank
    Code:
    ./nodebb restart
    but nodebb stop and start works
    Code:
    ./nodebb stop
    Stopping NodeBB. Goodbye!
    
    ./nodebb start
    Starting NodeBB
      "./nodebb stop" to stop the NodeBB server
      "./nodebb log" to view server output
      "./nodebb restart" to restart NodeBB
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    8:17 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 2
  9. RoldanLT

    RoldanLT Well-Known Member

    3,901
    949
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,298
    Local Time:
    6:17 PM
    1.11
    10.2
    And there is XenForo to NodeBB converter ;)
     
    • Informative Informative x 1
  10. ModeltogTossen

    ModeltogTossen I wish I could??

    313
    97
    28
    Dec 20, 2015
    Denmark
    Ratings:
    +143
    Local Time:
    12:17 PM
    1.9.12
    10.0.23
    This looks very sexy. I do need to try this guide out on one of my test install of centminmod.. Have seen some youtubes and got hooked - but switch from XF to NodeBB - I don't think so, but hey, believe in miracles so maybe. Faith moves mountains. Thanks for the guide @eva2000
     
    • Like Like x 1
  11. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    8:17 PM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah i'd start on XF first as NodeBB has importer for XF

    But there's no XF importer for NodeBB :)
     
  12. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    8:17 PM
    Nginx 1.13.x
    MariaDB 5.5
    Updated 1st post with Centmin Mod 123.09beta01's new addons/nodejs.sh installer for installing node.js 4.2.4 LTS via nodesource.com YUM repo instead of via source compile in addons/passenger.sh addon.
     
  13. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    8:17 PM
    Nginx 1.13.x
    MariaDB 5.5
    Updated 1st post with latest NodeBB version reference as you have to check Releases · NodeBB/NodeBB · GitHub for latest version and adjust your gitclone branch/tag version you want i.e. old guide had v0.9.0 while latest has v1.4.5

    without Nginx proxy setup yet

    upload_2017-4-6_10-54-20.png

    upload_2017-4-6_10-55-40.png

    Also updated above guide's Centmin Mod Nginx reverse proxy instructions minor change for
    Code (Text):
    proxy_pass http://127.0.0.1:4567/nodebb;
    

    to
    Code (Text):
    proxy_pass http://127.0.0.1:4567;
    

    with Centmin Mod Nginx reverse proxy

    upload_2017-4-6_11-12-33.png
    upload_2017-4-6_11-48-53.png

    Code (Text):
    cat /home/nginx/domains/newdomain.com/public/nodebb/config.json
    {
        "url": "http://newdomain.com:4567",
        "secret": "ec8d3716-e398-4e59-9c6b-666292e7b4ad",
        "database": "redis",
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": "",
            "database": "9"
        }
    }
    


    the nodebb setup output
    Code (Text):
    ./nodebb setup
    6/4 00:44:01 [4296] - info: NodeBB Setup Triggered via Command Line
    
    Welcome to NodeBB!
    
    This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed.
    Press enter to accept the default setting (shown in brackets).
    URL used to access this NodeBB (http://localhost:4567) http://newdomain.com:4567
    Please enter a NodeBB secret (ec8d3716-e398-4e59-9c6b-666292e7b4ad)
    Which database to use (mongo) redis
    
    6/4 00:45:21 [4296] - info: Now configuring redis database:
    Host IP or address of your Redis instance (127.0.0.1)
    Host port of your Redis instance (6379)
    Password of your Redis database
    Which database to use (0..n) (0) 9
    Configuration Saved OK
    Populating database with default configs, if not already set...
    6/4 00:45:34 [4296] - warn: [cache-buster] could not read cache buster: ENOENT: no such file or directory, open '/home/nginx/domains/newdomain.com/public/nodebb/build/cache-buster'
    Enabling default theme: nodebb-theme-persona
    No categories found, populating instance with default categories
    6/4 00:45:34 [4296] - warn: No administrators have been detected, running initial user setup
    
    Administrator username admin
    Administrator email address
    Password
    Confirm Password
    Creating welcome post!
    Enabling default plugins
    6/4 00:47:51 [4296] - info: [install/defaultPlugins] customDefaults
    6/4 00:47:51 [4296] - info: [install/enableDefaultPlugins] activating default plugins 0=nodebb-plugin-composer-default, 1=nodebb-plugin-markdown, 2=nodebb-plugin-mentions, 3=nodebb-widget-essentials, 4=nodebb-rewards-essentials, 5=nodebb-plugin-soundpack-default, 6=nodebb-plugin-emoji-extended, 7=nodebb-plugin-emoji-one
    6/4 00:47:51 [4296] - info: Beginning database schema update
    6/4 00:47:51 [4296] - info: [2016/09/22] Setting category recent tids - skipped!
    6/4 00:47:51 [4296] - info: [2016/10/8] favourite -> bookmark refactor - skipped!
    6/4 00:47:51 [4296] - info: [2016/10/14] Creating sorted sets for post replies - skipped!
    6/4 00:47:51 [4296] - info: [2016/11/22] Update global and user language keys - skipped!
    6/4 00:47:51 [4296] - info: [2016/11/25] Creating sorted sets for pinned topics - skipped!
    6/4 00:47:51 [4296] - info: [2017/2/25] Update global and user sound settings - skipped!
    6/4 00:47:51 [4296] - info: [2017/2/28] Update urls in config to `/assets` - skipped!
    6/4 00:47:51 [4296] - info: [upgrade] Schema already up to date!
    6/4 00:47:51 [4296] - info: [build] Building javascript
    6/4 00:47:51 [4296] - info: [build] Building client-side CSS
    6/4 00:47:59 [4296] - info: [build] clientCSS => Completed in 7.743s
    6/4 00:47:59 [4296] - info: [build] Building admin control panel CSS
    6/4 00:48:03 [4296] - info: [build] acpCSS => Completed in 3.934s
    6/4 00:48:03 [4296] - info: [build] Building templates
    6/4 00:48:03 [4296] - info: [build] tpl => Completed in 0.132s
    6/4 00:48:03 [4296] - info: [build] Building language files
    6/4 00:48:08 [4296] - info: [build] js => Completed in 16.46s
    6/4 00:48:13 [4296] - info: [build] lang => Completed in 9.635s
    6/4 00:48:13 [4296] - info: [build] Linking sound files
    6/4 00:48:13 [4296] - info: [build] sound => Completed in 0.006s
    6/4 00:48:13 [4296] - info: [build] Asset compilation successful. Completed in 21.554s.
    
        ================================================================================================================================================================================================================================================
    
    NodeBB Setup Completed. Run './nodebb start' to manually start your NodeBB server.
    

    Get a warn error
    Code (Text):
    warn: [cache-buster] could not read cache buster: ENOENT: no such file or directory, open '/home/nginx/domains/newdomain.com/public/nodebb/build/cache-buster'
    

    but seems to be created now
    Code (Text):
    ls -lah /home/nginx/domains/newdomain.com/public/nodebb/build/cache-buster
    -rw-r--r-- 1 root nginx 11 Apr  6 00:48 /home/nginx/domains/newdomain.com/public/nodebb/build/cache-buster
    


    Email plugins

    upload_2017-4-6_11-54-41.png

    Main Admin Dashboard Page

    upload_2017-4-6_11-56-21.png

    To scale Nodebb as per Scaling NodeBB — NodeBB 1.x documentation, edit config.json and add this line
    Code (Text):
        "port": ["4567", "4568", "4569"],
    

    so it becomes
    Code (Text):
    {
        "url": "http://newdomain.com:4567",
        "secret": "ec8d3716-e398-4e59-9c6b-666292e7b4ad",
        "database": "redis",
        "port": ["4567", "4568", "4569"],
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": "",
            "database": "9"
        }
    }

    then restart nodebb
    Code (Text):
    cd /home/nginx/domains/newdomain.com/public/nodebb
    ./nodebb restart
    

    Code (Text):
        "port": ["4567", "4568", "4569"],
    

    verify 3 node.js instances are listening on ports 4567, 4568, 4569
    Code (Text):
    netstat -lnpt | grep 45
    tcp        0      0 0.0.0.0:4567            0.0.0.0:*               LISTEN      7460/node          
    tcp        0      0 0.0.0.0:4568            0.0.0.0:*               LISTEN      7466/node          
    tcp        0      0 0.0.0.0:4569            0.0.0.0:*               LISTEN      7472/node
    

    add to your nginx vhost i.e. /usr/local/nginx/conf/conf.d/newdomain.com.conf above server {} context
    Code (Text):
    upstream io_nodes {
       ip_hash;
       server 127.0.0.1:4567;
       server 127.0.0.1:4568;
       server 127.0.0.1:4569;
    }
    

    edit /home/nginx/domains/newdomain.com/include-nodebb.conf and change proxy_pass setting from
    Code (Text):
    proxy_pass http://127.0.0.1:4567;
    

    to
    Code (Text):
    proxy_pass http://io_nodes;
    

    restart nginx
    Code (Text):
    ngxrestart
    

    updated contents of /home/nginx/domains/newdomain.com/include-nodebb.conf
    Code (Text):
        location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) {
            root /home/nginx/domains/newdomain.com/public/nodebb/public;
        }
    
        location / {
            root /home/nginx/domains/newdomain.com/public/nodebb/public;
    #        proxy_pass http://127.0.0.1:4567;
            proxy_pass http://io_nodes;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    
     
    Last edited: Apr 6, 2017
    • Winner Winner x 3