Alibaba Cloud Deploys RSSHub Stepping Pit Notes

Alibaba Cloud Deploys RSSHub Stepping Pit Notes

Motivation:

    Because I was amwayed by a minority of rss, I found a few rss feeds and started playing that day. I usually see a lot of station b, but station b does not open the rss port, so I discovered the open source project RSSHub . After using the official interface for a while, I found that the interface is blocked quite badly, and the best way is to start self-build.
    At the beginning, under the Amway of classmate Ah Xu , I chose to use Tencent Cloud for self-build, because Tencent Cloud's cloud development environment will come with RSSHub service deployment, which is one-click (if you are lucky, you will write out the process), but The way Tencent Cloud deploys consumes about 1 yuan a day, and the price of deploying it for a year is 300+. This is different from what is described in the article by Mr. Ah Xu. It is probably because Tencent Cloud raised the price. So after the purchased resources were exhausted, I decided to deploy them on my Alibaba Cloud server.

step

Clone the RSSHub repository

git clone https://github.com/DIYgod/RSSHub.git
cd RSSHub

install dependencies

npm install

    When relying on installation on my server, an error will be reported:

wanted: {“node”:"^10.12.0 || >=12.0.0"} (current: {“node”:“4.2.6”,“npm”:"3.5.})

    It can be seen that the versions of node and npm are not enough, so I started to upgrade. I decided to upgrade node to the latest version. The latest version on the official website is v16.3.0.

  1. Download linux64-bit binaries
wget https://nodejs.org/dist/v16.3.0/node-v16.3.0-linux-x64.tar.xz
  1. unzip files
tar xvf node-v16.3.0-linux-x64.tar.xz
  1. Create a soft connection, but this step has no effect for me.
ln -s /home/node-v16.3.0-linux-x64/bin/node /usr/local/bin/node
ln -s /home/node-v16.3.0-linux-x64/bin/npm /usr/local/bin/npm
  1. Because the previous step didn't work, the version numbers of node and nmp were still old, so I decided to modify the profile file. Add the following code to the /etc/profile file
#set for nodejs
export NODE_HOME=/home/node-v16.3.0-linux-x64
export PATH=$NODE_HOME/bin:$PATH

    After that, the version numbers of node and nmp were successfully modified.
Version display
   Then continue to execute, prompting that the installation is successful

npm install

starting program

npm start

   Open the port 1200 of Aliyun, and you can access this interface outside, which proves that the startup is successful
Alibaba cloud port    
Successful startup interface

alternate route

   Replace the relevant route and immediately import it into the rss reader. I use inoreader.
xml file

RSSHub keeps running

    Because it is a reading tool, let it work 7*24 hours. So a persistent program pm2 is needed, first install pm2 globally.

npm install pm2 -g

    Then in the RSSHub directory:

pm2 start lib/index.js --name rsshub

    If it prompts that the pm2 command cannot be found, you need to make a soft link first, and then open index.js

ln -s /home/node-v16.13.2-linux-x64/bin/pm2 /usr/local/bin/pm2

References

RSSHub official deployment document
CentOS7 system deployment RSSHub
deployment Node.js environment (CentOS 7)
pm2 tutorial

Guess you like

Origin blog.csdn.net/qq_37263248/article/details/118111291