Yeah @kurulumu-Net you can change port in config.json in one of the NodeBBs and change to the same port in the proxy-pass part of the corresponding nginx config.
Default port is 4567, one will need to be changed.
Hi All,
The recommended setup for nvm/npm/nodejs is per user.
Lets assume you created a user nodebb, installed nodejs under it, and revised .bashrc to set environment variables to point to the latest version (standard procedure):
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" #
Systemctl expects full path to executable. Unfortunately, that path may change when nodejs gets updated.
So how do we hack systemctl to use a dynamic path?
See config below:
[Unit]
Description=NodeBB Service
After=system.slice multi-user.target mongod.service syslog.target
[Service]
Type=idle
User=nodebb
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=nodebb
ExecStartPre=/bin/bash -c -l '/usr/bin/env > /tmp/tmp_env ; /bin/echo NODE_ENV=production >> /tmp/tmp_env'
EnvironmentFile=/tmp/tmp_env
WorkingDirectory=/path_to_nodebb
ExecStart=/usr/bin/env node loader.js --no-silent --no-daemon
Restart=always
[Install]
WantedBy=multi-user.target
Pay attention: Type=idle replaces Type=simple.
Good luck!
JJ.