萌樱这里分享一个基于 Node.js + MongoDB 的前后端分离的动漫 CMS 。到目前为止,V1.0 版已经停更,V2.0 版还在写。这套 CMS 有免费跟付费两个版本,付费版有 Andorid 客户端,而且能够快速添加番剧,其他的功能与免费版基本一样。
Qinvideo
运行环境
安装 Node.js
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
用 OneinStack 安装 Nginx + MongoDB
wget -c http://mirrors.linuxeye.com/oneinstack-full.tar.gz && tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh --nginx_option 1 --db_option 15 --dbinstallmethod 1 --dbrootpwd oneinstack --reboot
数据库
为了减少不必要的麻烦以及运行错误(大雾),先关闭 OneinStack 安装 MongoDB 时默认开启的用户认证。
打开 /etc/mongod.conf
,修改 authorization
为 disabled
并保存
# 重启 MongoDB
service mongod restart
创建一个数据库并在数据库里插入一条数据
mongo
# 创建数据库
use 数据库名
# 插入一条数据
db.repo.insert({"name":"qinvideo"})
# 查看数据库
show dbs
exit
下载安装
用 OneinStack 新建一个站点,创建时添加伪静态
cd oneinstack
./vhost.sh
打开网站目录,下载 Qinvideo 并安装
cd /data/wwwroot/域名
git clone -b master https://github.com/Qinmei/qinvideo.git tmp && mv tmp/.git . && rm -rf tmp && git reset --hard
npm install
修改网站目录权限
find /data/wwwroot/ -type d -exec chmod 755 {} \;
find /data/wwwroot/ -type f -exec chmod 644 {} \;
chown -R www:www /data/wwwroot/网站域名
打开 config.js
修改配置文件
- 修改
uri
为"mongodb://localhost:27017/数据库名"
- 修改
salt
以及tokenSecret
为任意字符串
# 试运行
node app.js
按 Ctrl + C
终止运行
网站配置
打开 /usr/local/nginx/conf/vhost/网站域名.conf
修改网站运行目录
root /data/wwwroot/网站域名/public;
打开 /usr/local/nginx/conf/rewrite/伪静态.conf
,添加以下配置
client_max_body_size 20M;
location /api/ {
proxy_pass http://localhost:9000/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /qinmei {
alias /home/qinvideo-node/public;
index /backend/index.html;
try_files $uri $uri/ /backend/index.html?$args;
}
location /web {
alias /home/qinvideo-node/public;
index /pc/index.html;
try_files $uri $uri/ /pc/index.html?$args;
}
location /m {
alias /home/qinvideo-node/public;
index /h5/index.html;
try_files $uri $uri/ /h5/index.html?$args;
}
location =/ {
if ($http_user_agent ~* (mobile|nokia|iphone|ipad|android|samsung|htc|blackberry)) {
rewrite ^(.*) $scheme://$host/m/ permanent;
}
if ($http_user_agent !~* (mobile|nokia|iphone|ipad|android|samsung|htc|blackberry)){
rewrite ^(.*) $scheme://$host/web/ permanent;
}
}
重启 Nginx
service nginx restart
运行
打开网站目录运行 app.js 即可
cd /data/wwwroot/域名
apt install -y screen
screen -S qinvideo
node app.js
成功运行后按 Ctrl + A
再按 D
后台运行。
网址/web 是 PC 端的前端地址
网址/m 是移动端的前端地址
😋 Enjoy it !
版权声明:本文为原创文章,版权归 萌樱 所有。
本文链接:https://moesakura.world/archives/qinvideo/
所有原创文章采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可。
您可以自由的转载和修改,但请务必注明文章来源并且不可用于商业目的。
小姐姐,你的云盘是什么系统啊,我也想弄一个 能把源码下载地址发我么
这个是 OneIndex 的修改版,GitHub:https://github.com/SomeBottle/OneIndex