Cent OS7搭建RssHub
一、Cent OS7环境准备
- git
- nodejs
- npm
1、安装git
yum install git
2、安装node js & npm
NodeSource is a company dedicated to providing enterprise-grade Node support and they maintain a consistently-updated Node.js repository for Linux distributions.
To install Node.js and npm from the NodeSource repositories on your CentOS 7 system, follow these steps:
① Add NodeSource yum repository
The current LTS version of Node.js is version 10.x. If you want to install version 8 just change setup_10.x with setup_8.x in the command below.
当然我装的是16版本(curl -sL也可以)
curl --silent --location https://rpm.nodesource.com/setup_16.x | sudo bash
② Install Node.js and npm
Once the NodeSource repository is enabled, install Node.js and npm by typing:
sudo yum install nodejs
When prompted to import the repository GPG key, type y, and press Enter.
如果以上安装node的操作有问题,可以执行如下命令:
sudo yum clean all
若本地存在多个nodesoucre,可以执行以下命令,在重新yum安装命令
sudo rm -fv /etc/yum.repos.d/nodesource*
③ Verify the Node.js and npm Installation
Verify the Node.js and npm Installation
node --version
npm --version
二、安装RssHub服务
部署 RSSHub 最直接的方式就是手动部署,可以按照以下步骤将 RSSHub 部署在您的电脑、服务器或者其他任何地方。
① 首先是下载 RSSHub 的源码:
git clone https://github.com/DIYgod/RSSHub.git
cd RSSHub
② 下载完成后,需要安装依赖
npm i
③ 启动RssHub服务
此时还要保持在rsshub文件下操作:
npm start

如果报了如下错误:

那么请检查rsshub文件夹下的:
package.json文件的dependencies中是否有module-alias
app.js文件的第一行是否有const moduleAlias = require('module-alias');
如果以上两个都存在,那么再查看rsshub文件夹下是否有:

如果没有那么就是少了npm i这一步,重新执行npm i,看到生成上图缺少的两个内容后,再执行npm start启动即可
③访问测试
ip:1200端口
此处1200端口需要在服务器上开启

看到如下图片就是成功了

三、保持运行
nohup npm start &

然后就可以ctrl + C 运行其它命令了,这个服务就会一直在后台运行着,不会受到影响,也不会中断
注意:
curl命令 是一个利用URL规则在命令行下工作的文件传输工具。它支持文件的上传和下载,所以是综合传输工具,但按传统,习惯称curl为下载工具。作为一款强力工具,curl支持包括HTTP、HTTPS、ftp等众多协议,还支持POST、cookies、认证、从指定偏移处下载部分文件、用户代理字符串、限速、文件大小、进度条等特征。做网页处理流程和数据检索自动化,curl可以助一臂之力。
-s, --silent Silent mode. Don't output anything
-L, --location Follow redirects (H)
Cent OS7搭建RssHub更多相关文章
JavaScript CSS Vue3 实现一个简单的Loading
配置和使用nvm免安装版本(nvm-noinstall.zip)
HarmonyOS:使用Node-API实现ArkTS与C/C++跨语言交互
【NodeJS】NodeJS+mongoDB在线版开发简单RestfulAPI (一):项目简介及安装依赖
【NodeJS】NodeJS+mongoDB在线版开发简单RestfulAPI (四):状态码的使用
【NodeJS】NodeJS+mongoDB在线版开发简单RestfulAPI (五):POST上传文件的设置
【NodeJS】NodeJS+mongoDB在线版开发简单RestfulAPI (六):token的设置
【NodeJS】NodeJS+mongoDB在线版开发简单RestfulAPI (七):MongoDB的设置
【NodeJS】NodeJS+mongoDB在线版开发简单RestfulAPI (三):Cors的设置及.env文件的设置
【NodeJS】NodeJS+mongoDB在线版开发简单RestfulAPI (二):项目文件夹架构及路由的设置
【NodeJS】NodeJS+mongoDB在线版开发简单RestfulAPI (八):API说明(暂时完结,后续考虑将在线版mongoDB变为本地版)
报error:0308010C:digital envelope routines::unsupported错--nodejs版本过高(nvm安装(更换)不同版本nodejs)
小结---安装nvm解决node版本不兼容的问题(node版本切换)