banner
槿呈Goidea

槿呈Goidea

读书|新知|生活禅
twitter
tg_channel
youtube

Deploying Node.js version of TiddlyWiki on VPS

Deploying Node.js version of TiddlyWiki is not complicated. However, some preparation work needs to be done before deployment.

Preparation

  1. Prepare a VPS and install Baota Panel.
  2. Install PM2 on the VPS.
  3. Prepare a domain name.

Step 1: Install TiddlyWiki

After completing the preparation work, you can start installing TiddlyWiki on the VPS.

First, log in to the VPS via SSH.

Then enter sudo npm install -g tiddlywiki to perform a global installation.

Step 2: Create a website

Open the Baota Panel backend on the VPS, click on "Websites" on the left side of the panel, create a new website, enter your domain name (this domain name will be used to access TiddlyWiki in the future), and configure the other settings as follows:

img

Step 3: Deploy TiddlyWiki service

First, enter cd /www/wwwroot/your_domain in SSH.

Then enter tiddlywiki mywiki –init server.

This will create a mywiki folder in /www/wwwroot/your_domain and deploy TiddlyWiki.

Step 4: Configure PM2 manager

First, enter cd /www/wwwroot/your_domain/mywiki in SSH.

Then enter pm2 start "tiddlywiki --server".

At this point, you can enter pm2 list to check if the TiddlyWiki server is running properly.

Then enter pm2 startup and pm2 save in sequence.

Step 5: Configure firewall and reverse proxy

First, allow port 8080 in the security settings of the Baota Panel.

img

Then configure reverse proxy in the website settings.

img

In addition, domain name certificates need to be configured.

More secure access

At this point, you can open your TiddlyWiki using the domain name and start taking notes.

However, at this point, anyone can open your TiddlyWiki using the domain name, which is not secure.

To deploy it more securely, there are two ways: only you can open TiddlyWiki, or everyone can open it but only you can edit it.

Method 1

Keep other deployment steps unchanged, only modify "Step 4: Configure PM2 manager".

First, enter cd /www/wwwroot/your_domain/mywiki in SSH.

Then enter pm2 start tiddlywiki --name "mywiki" -- --listen host=127.0.0.1 port=8080 username=username password=password.

At this point, you can enter pm2 list to check if the TiddlyWiki server is running properly.

Then enter pm2 startup and pm2 save in sequence.

This way, you can only access your TiddlyWiki by entering the username and password, which improves security.

Method 2

Open the Baota Panel, create a new file in the root directory of the website (/www/wwwroot/your_domain) and name it start-wiki.sh, then enter the following content in the file:

 #!/bin/bash
 tiddlywiki /www/wwwroot/your_domain/mywiki/ --listen host=127.0.0.1 port=8080 "readers=(anon)" writers=your_username username=your_username password=your_password

Here, your_username and your_password need to be modified to your own username and password.

Next, keep other steps unchanged, only modify "Step 4: Configure PM2 manager".

First, enter chmod +x /www/wwwroot/your_domain/start-wiki.sh in SSH to add execute permission to start-wiki.sh.

Then enter pm2 start /www/wwwroot/your_domain/start-wiki.sh --name "tiddlywiki".

At this point, you can enter pm2 list to check if the TiddlyWiki server is running properly.

Then enter pm2 startup and pm2 save in sequence.

This way, you can use TiddlyWiki as an administrator by accessing https://your_domain/login-basic, and other visitors can access it normally but cannot modify your note content and configuration.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.