https://github.com/lovasoa/whitebophir
安裝WBO
1.取得WBO (nodejs 版本 >= v10.0)
代碼: 選擇全部
git clone https://github.com/lovasoa/whitebophir.git
cd whitebophir代碼: 選擇全部
npm install --production代碼: 選擇全部
PORT=5001 npm start代碼: 選擇全部
ufw allow 5001/tcp5.建立使用者並給予權限
https://blog.gtwang.org/linux/linux-cho ... -tutorial/
代碼: 選擇全部
useradd wbo
chown -R wbo /home/wbo/https://docs.npmjs.com/cli/v7/commands/npm-start
https://blog.gtwang.org/linux/node-js-a ... -tutorial/
注意:網查為Environment=NODE_PORT=5001但會報錯,須將_NODE拿掉,改為PORT=5001
代碼: 選擇全部
vi /etc/systemd/system/wbo.service代碼: 選擇全部
[Unit]
Description=wbo whiteboard
After=syslog.target network.target
[Service]
Type=simple
User=wbo
Group=wbo
WorkingDirectory=/home/wbo/whitebophir
Environment=PORT=5001 NODE_ENV=production
ExecStart=/usr/bin/node /home/wbo/whitebophir/server/server.js
[Install]
WantedBy=multi-user.target