mkdir wiki tar xzf wiki-js.tar.gz -C ./wiki cd ./wiki
mv config.sample.yml config.yml
数据库配置
安装postgresql
apt install postgresql postgresql-contrib
创建数据库
sudo -u postgres psql
psql (15.8 (Debian 15.8-0+deb12u1)) Type "help" for help.
postgres=# CREATE DATABASE wiki; CREATE DATABASE postgres=# CREATE USER wikijs WITH PASSWORD 'wikijsrocks'; CREATE ROLE postgres=# GRANT ALL PRIVILEGES ON DATABASE wiki TO wikijs; GRANT postgres=# \c wiki You are now connected to database "wiki" as user "postgres". wiki=# GRANT ALL PRIVILEGES ON SCHEMA public TO wikijs; GRANT wiki=# GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO wikijs; GRANT wiki=# GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO wikijs; GRANT postgres=# \q
[Service] Type=simple ExecStart=/usr/bin/node server #自己wiki/server的绝对路径 Restart=always # Consider creating a dedicated user for Wiki.js here: User=wiki Environment=NODE_ENV=production WorkingDirectory=/var/wiki #自己的wiki安装路径