二次元浓度较高的在线网页聊天室
下文将展示如何在 Debian 10 下无域名搭建 fiora
环境
- Debian 10
参考
步骤
以下指令均在 root 用户下执行,其他用户请酌情添加 sudo
环境安装
Node.js
fiora 官方推荐安装 14 LTS,执行
curl -fsSL https://deb.nodesource.com/setup_14.x | bash - apt install -y nodejs
yarn && pm2
安装 pm2 方便在后台运行,如果有洁癖不想用 pm2 也可以用 systemd,见后文
执行
npm install -g yarn pm2
MongoDB
安装执行
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list apt install -y mongodb-org
安装后不会自动启动,使用 systemd 启动
systemctl start mongod systemctl status mongod
安装 fiora
- 获取源码
- 执行
git clone https://github.com/yinxin630/fiora.git -b master
- 执行
- 安装 node 依赖
- 执行
cd fiora yarn install
- 执行
- 编译客户端
- 执行
yarn build:client && yarn move-dist
- 执行
- 启动
- 执行
yarn start
fiora 默认监听在 9200 端口
- 执行
配置文件
在 fiora 项目根目录新建文件 .env,以 “key=value” 的格式添加参数
添加 Port 参数可以修改监听端口,完整的配置参数见 Config · fiora
后台运行
可以使用 pm2 或 systemd 两种方式在后台运行 fiora
pm2
直接执行
pm2 start yarn --name fiora -- start # 查看已运行的服务 pm2 ls # 查看 fiora 日志 pm2 logs fiora
systemd
在 /etc/systemd/system 下 新建 fiora.service 文件,写入以下内容
[Unit] Description=fiora online chat [Service] Restart=always WorkingDirectory=[fiora 根目录] ExecStart=/usr/bin/yarn start [Install] WantedBy=multi-user.target
启动服务
systemctl start fiora systemctl status fiora
Hi there, do you speak English? I’m from 2captcha.com Can we talk about sponsored post in English? Write me via e-mail, please