How to install Wiki.js + Node.js in the hosting plan - WebFaction

Created: July 2, 2020, 1:09 p.m.
Update: Oct. 29, 2020, 7:27 p.m.
How to install Wiki.js + Node.js in WebFaction

Environment

Webfaction Hosting webfaction.com or a hosting plan.
ssh access Node.js  12.18.2
Wiki-js  2.4.107
Let's Encrypt PostgreSQL

Domain propagation ready!

wiki.domain.com

Sources

https://wiki.js.org/
https://docs.requarks.io/install
https://docs.requarks.io/install/linux https://webfaction.com

PostgreSQL Server, new data base.

db 		wiki
user wikiu
pass wikipass host localhost

Download, setup and install

$ cd /home/USER/webapps/wiki
$ wget https://github.com/Requarks/wiki/releases/download/2.4.107/wiki-js.tar.gz
tar xzf wiki-js.tar.gz
$ cp config.sample.yml config.yml
# Database
# ---------------------------------------------------------------------
# Supported Database Engines:
# - postgres = PostgreSQL 9.5 or later
db:
  type: postgres
  # PostgreSQL / MySQL / MariaDB / MS SQL Server only:
  host: localhost
  port: 5432
  user: wikiu
  pass: wikipass
  db: wiki
  ssl: false
WebFaction create scripts to start, stop and restart process Node.
/home/USER/webapps/wiki/bin/
node (bin)
start (script)
stop (script)

Run web configuration

$ ./bin/node wiki.js configure
OpenBrowser at http://wiki.domain.com and follow steps to finish installation.

Start Process Node to run server

$ ./bin/node server/index.js start
Loading configuration from /home/USER/webapps/wiki/config.yml... OK
2020-07-02T16:39:01.199Z [MASTER] info: =======================================
2020-07-02T16:39:01.201Z [MASTER] info: = Wiki.js 2.4.107 =====================
2020-07-02T16:39:01.201Z [MASTER] info: =======================================
2020-07-02T16:39:01.201Z [MASTER] info: Initializing...
2020-07-02T16:39:01.573Z [MASTER] info: Using database driver pg for postgres [ OK ]

Crontab

webfaction port?

Alter Script path o JS file server

vim bin/start
from
nohup /home/gpsi/webapps/gpsi_doc/bin/node /home/gpsi/webapps/gpsi_doc/hello-world.js > /dev/null 2>&1 &
to
nohup /home/gpsi/webapps/gpsi_doc/bin/node /home/gpsi/webapps/gpsi_doc/server/index.js > /dev/null 2>&1 &
Well done!

Tiago de Souza Moraes - teago.futuria.com.br - 2020 // CSS by UIKIT CSS