Ubuntu18.04安裝Wikijs

pengjielee發表於2019-10-29

Ubuntu18.04安裝Wikijs

下載安裝

$ mkdir /var/www/wiki
$ cd /var/www/wiki
$ curl -sSo- https://wiki.js.org/install.sh | bash  
複製程式碼

配置

$ node wiki configure 

visit http://yourip:3000/
複製程式碼

安裝pm2

$ npm install pm2 -g
複製程式碼

管理

$ node wiki stop
$ node wiki start
$ node wiki restart

$ pm2 list
$ pm2 show [pid]
$ pm2 restart [pid]
$ pm2 delete [pid]
$ pm2 start [pid]
$ pm2 stop [pid]
$ pm2 --help
複製程式碼

Nginx反向代理

server {
    listen 80;
    listen [::]:80;
    server_name  wiki.example.com;

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_next_upstream error timeout http_502 http_503 http_504;
    }
}
複製程式碼

相關文章