Join the community today
Become a Member

NodeBB NodeBB + Centmin Mod Nginx

Discussion in 'Forum software usage' started by eva2000, Jun 5, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:18 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    NodeBB node.js + redis backend based forums is basically what started this forum journey in the first place if you read my explanation at https://community.centminmod.com/threads/centmin-mod-community-forum-online.1/.

    The 3rd how to Youtube video for passenger.sh Addon install for Centmin Mod has an example of how to install NodeBB forums (https://community.centminmod.com/threads/how-to-install-centmin-mod-videos.4/).


    I also posted some useful redis information at https://community.nodebb.org/topic/932/redis-useful-info along with a custom written shell script for redisinfo.sh at https://gist.github.com/centminmod/7d3e562fb87fa8ef263a

    So I'll just post my Centmin Mod Nginx vhost configuration used to reverse proxy the node.js web socket.io instance.

    Code:
    server {
        listen 80;
    
        server_name forum.example.org;
    
        location / {
            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_pass http://127.0.0.1:4567/;
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
    sample redisinfo.sh output

    Code:
    ./redisinfo.sh      
    --------------------------------------------------------------------------
    redis-cli 2.8.9
    --------------------------------------------------------------------------
    redis-cli info
    # Server
    redis_version:2.8.9
    redis_git_sha1:00000000
    redis_git_dirty:0
    redis_build_id:b548a658a720fb3e
    redis_mode:standalone
    os:Linux 2.6.32-431.el6.x86_64 x86_64
    arch_bits:64
    multiplexing_api:epoll
    gcc_version:4.4.7
    process_id:31142
    run_id:a1bde5d043367ae6de1d6ea462ed12801e8cc58c
    tcp_port:6379
    uptime_in_seconds:5960
    uptime_in_days:0
    hz:10
    lru_clock:8155044
    config_file:/etc/redis.conf
    
    # Clients
    connected_clients:1
    client_longest_output_list:0
    client_biggest_input_buf:0
    blocked_clients:0
    
    # Memory
    used_memory:3669672
    used_memory_human:3.50M
    used_memory_rss:18681856
    used_memory_peak:225820744
    used_memory_peak_human:215.36M
    used_memory_lua:33792
    mem_fragmentation_ratio:5.09
    mem_allocator:jemalloc-3.2.0
    
    # Persistence
    loading:0
    rdb_changes_since_last_save:19033236
    rdb_bgsave_in_progress:0
    rdb_last_save_time:1400663949
    rdb_last_bgsave_status:ok
    rdb_last_bgsave_time_sec:0
    rdb_current_bgsave_time_sec:-1
    aof_enabled:0
    aof_rewrite_in_progress:0
    aof_rewrite_scheduled:0
    aof_last_rewrite_time_sec:-1
    aof_current_rewrite_time_sec:-1
    aof_last_bgrewrite_status:ok
    aof_last_write_status:ok
    
    # Stats
    total_connections_received:2944
    total_commands_processed:23709308
    instantaneous_ops_per_sec:0
    rejected_connections:0
    sync_full:0
    sync_partial_ok:0
    sync_partial_err:0
    expired_keys:0
    evicted_keys:0
    keyspace_hits:5961843
    keyspace_misses:539709
    pubsub_channels:0
    pubsub_patterns:0
    latest_fork_usec:586
    
    # Replication
    role:master
    connected_slaves:0
    master_repl_offset:0
    repl_backlog_active:0
    repl_backlog_size:1048576
    repl_backlog_first_byte_offset:0
    repl_backlog_histlen:0
    
    # CPU
    used_cpu_sys:97.93
    used_cpu_user:71.73
    used_cpu_sys_children:0.00
    used_cpu_user_children:0.02
    
    # Keyspace
    
    --------------------------------------------------------------------------
    redis-cli --intrinsic-latency 10
    Max latency so far: 4 microseconds.
    Max latency so far: 6 microseconds.
    Max latency so far: 13 microseconds.
    Max latency so far: 16 microseconds.
    Max latency so far: 32 microseconds.
    
    3214753 total runs (avg 3 microseconds per run).
    Worst run took 10.67x times the avarege.
    
    --------------------------------------------------------------------------
    vmstat 1 10
    procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
    r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
    0  0      0 15453032 140484 407852    0    0     0     0   16   24  4  5 91  0  0
    0  0      0 15453032 140484 407852    0    0     0     0  188  150  0  0 100  0  0
    0  0      0 15453032 140484 407852    0    0     0     0  126  138  0  0 100  0  0
    0  0      0 15453032 140484 407852    0    0     0     2  151  188  0  0 100  0  0
    1  0      0 15453032 140484 407852    0    0     0     0  129  146  0  0 100  0  0
    0  0      0 15453032 140484 407852    0    0     0     0  132  154  0  0 100  0  0
    0  0      0 15453032 140484 407852    0    0     0     0  125  142  0  0 100  0  0
    0  0      0 15453032 140484 407852    0    0     0     0  136  150  0  0 100  0  0
    0  0      0 15453032 140484 407852    0    0     0     0  124  138  0  0 100  0  0
    0  0      0 15453040 140484 407852    0    0     0     0  137  164  0  0 100  0  0
    --------------------------------------------------------------------------
    
    smem -kU redis
      PID User     Command                         Swap      USS      PSS      RSS
    31142 redis    /usr/sbin/redis-server 127.        0    19.1M    19.2M    19.7M
    --------------------------------------------------------------------------
    
    --------------------------------------------------------------------------
    smem -kmU redis
    Map                                       PIDs   AVGPSS      PSS
    /usr/lib/locale/locale-archive               1        0        0
    [vdso]                                       1        0        0
    [vsyscall]                                   1        0        0
    /lib64/libdl-2.12.so                         1     8.0K     8.0K
    /lib64/libm-2.12.so                          1     8.0K     8.0K
    /lib64/ld-2.12.so                            1     9.0K     9.0K
    /lib64/libpthread-2.12.so                    1    12.0K    12.0K
    [stack]                                      1    16.0K    16.0K
    /lib64/libc-2.12.so                          1    49.0K    49.0K
    [heap]                                       1    52.0K    52.0K
    /usr/sbin/redis-server                       1   476.0K   476.0K
    <anonymous>                                  1    18.5M    18.5M
    --------------------------------------------------------------------------
    
    --------------------------------------------------------------------------
    smem -tpk
      PID User     Command                         Swap      USS      PSS      RSS
    2628 root     /sbin/mingetty /dev/tty4           0    80.0K    99.0K   576.0K
    2622 root     /sbin/mingetty /dev/tty1           0    84.0K   103.0K   580.0K
    2624 root     /sbin/mingetty /dev/tty2           0    84.0K   103.0K   580.0K
    2626 root     /sbin/mingetty /dev/tty3           0    84.0K   103.0K   580.0K
    2630 root     /sbin/mingetty /dev/tty5           0    84.0K   103.0K   580.0K
    2632 root     /sbin/mingetty /dev/tty6           0    84.0K   103.0K   580.0K
    1295 nsd      /usr/local/sbin/nsd -c /etc        0    92.0K   234.0K   960.0K
    1341 root     mdadm --monitor --scan -f -        0   284.0K   297.0K   628.0K
    1298 nsd      /usr/local/sbin/nsd -c /etc        0   184.0K   302.0K   708.0K
    1244 root     auditd                             0   352.0K   372.0K   860.0K
      608 root     /sbin/udevd -d                     0   136.0K   374.0K     1.1M
    2634 root     /sbin/udevd -d                     0   116.0K   378.0K     1.1M
    2635 root     /sbin/udevd -d                     0   116.0K   378.0K     1.1M
    22942 root     nginx: master process /usr/        0   176.0K   407.0K     1.6M
    31771 root     /bin/bash /root/tools/redis        0   200.0K   429.0K     1.4M
    1361 dbus     dbus-daemon --system               0   504.0K   519.0K   868.0K
    1427 root     /bin/sh /usr/bin/mysqld_saf        0   320.0K   558.0K     1.6M
    2609 root     crond                              0   648.0K   684.0K     1.2M
    2498 nobody   /usr/local/bin/memcached -d        0   752.0K   771.0K     1.1M
        1 root     /sbin/init                         0   736.0K   779.0K     1.5M
    1405 root     /usr/sbin/sshd                     0   716.0K   807.0K     1.2M
    1260 root     /sbin/rsyslogd -i /var/run/        0     1.1M     1.1M     1.7M
    1413 ntp      ntpd -u ntp:ntp -p /var/run        0   960.0K     1.1M     2.1M
    2586 root     /usr/libexec/postfix/master        0     1.1M     1.2M     2.1M
    22944 nginx    nginx: worker process              0     1.5M     1.8M     3.4M
    31413 postfix  pickup -l -t unix -u               0     1.1M     1.8M     3.8M
    22943 nginx    nginx: worker process              0     1.5M     1.8M     3.4M
    22946 nginx    nginx: worker process              0     1.5M     1.8M     3.5M
    22945 nginx    nginx: worker process              0     1.5M     1.8M     3.5M
    2588 postfix  qmgr -l -t unix -u                 0     1.3M     1.9M     4.0M
    29348 root     sshd: root@pts/0                   0     1.9M     2.4M     4.1M
    29351 root     -bash                              0     2.6M     2.9M     4.0M
    2487 root     /usr/sbin/haveged -w 3072 -        0     3.1M     3.1M     3.5M
    1297 nsd      /usr/local/sbin/nsd -c /etc        0     4.2M     4.3M     4.8M
    22960 root     php-fpm: master process (/u        0     5.3M     5.4M     6.0M
    31796 root     python /usr/bin/smem -tpk          0     5.9M     6.0M     6.7M
    1335 root     /sbin/mdmon --takeover md0         0    11.4M    11.5M    12.4M
    26528 root     lfd - sleepin                      0    14.0M    14.0M    14.6M
    31142 redis    /usr/sbin/redis-server 127.        0    19.1M    19.2M    19.7M
    2474 mysql    /usr/sbin/mysqld --basedir=        0    38.2M    38.5M    40.1M
    -------------------------------------------------------------------------------
       40 9                                           0   122.9M   129.3M   163.6M
    --------------------------------------------------------------------------
    
    --------------------------------------------------------------------------
    free -mlt
                 total       used       free     shared    buffers     cached
    Mem:         15941        851      15090          0        137        398
    Low:         15941        851      15090
    High:            0          0          0
    -/+ buffers/cache:        315      15625
    Swap:         8039          0       8039
    Total:       23981        851      23130
    --------------------------------------------------------------------------
     
  2. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:18 PM
    Mainline
    10.2
    I will use this config in the future, when NodeBB is stable enough for Live Site.
     
  3. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:18 PM
    Mainline
    10.2
    By the way, How did you install nodebb?
    After or before Centminmod?
    Any tutorial/article?
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:18 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  5. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:18 PM
    Mainline
    10.2
    I tried to follow this article: Installing NodeBB on CentOS 6.5
    Assuming I already installed CentMinMod, Can I skip this step?
    sudo yum groupinstall "Development Tools" -y
     
  6. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:18 PM
    Mainline
    10.2
    And instead of "cd /path/to/nodebb/install/location".
    I will add my desired domain on centminmod menu #2 then I will proceed
    git clone git://github.com/designcreateplay/NodeBB.git nodebb on the new domain?
     
  7. eva2000

    eva2000 Administrator Staff Member

    53,558
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:18 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    should already have most tools, but running that command won't hurt

    still need to change directory (personal preference), for me i use /home/nginx/domains/domainname/ghost to keep it within the domain folder for easy backups