最近在找部落格系統,發現wiki 系統也是不錯的選項,所以在這邊筆記一下佈署方法。
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&\
apt install -y nodejs
node -v
npm -v (should output "8.11.0" or similar)
sudo -u postgres psql postgres -c "CREATE DATABASE wiki"
sudo -u postgres psql postgres -c "CREATE USER wikiap01 WITH PASSWORD 'wikijsrocks'"
sudo -u postgres psql postgres -c "GRANT ALL PRIVILEGES ON DATABASE wiki TO wikiap01"
sudo -u postgres psql wiki -c "GRANT ALL ON schema public TO wikiap01"
sudo -u postgres psql wiki -c "GRANT USAGE ON SCHEMA public TO wikiap01"
groupadd -g 800 wiki
useradd -u 800 -g 800 -M -s /sbin/nologin wiki
wget https://github.com/requarks/wiki/releases/download/v2.5.296/wiki-js.tar.gz
mkdir -p /home/wiki/wiki-server
tar xzf wiki-js.tar.gz -C /home/wiki/wiki-server
cd /home/wiki/wiki-server
mv config.sample.yml config.yml
host: 192.168.56.102
port: 5432
user: wikijs
pass: wikijsrocks
db: wiki
ssl: false
node server
Browse to http://YOUR-SERVER-IP:3000/ to complete setup!
[Unit]
Description=Wiki.js
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/node server
Restart=always
# Consider creating a dedicated user for Wiki.js here:
User=wiki
Environment=NODE_ENV=production
WorkingDirectory=/home/wiki/wiki-server
[Install]
WantedBy=multi-user.target
建議您可以嘗試看看Docker https://docs.requarks.io/install/docker
會更加快速容易
棒棒棒,推docker~