当前位置:网站首页>Build fiora chat room with Tencent lightweight cloud

Build fiora chat room with Tencent lightweight cloud

2022-06-24 01:28:00 Diligent thinking

Preface

A few days ago, I heard a friend say , They led Tencent cloud light 246 Still eating ash , I saw this system in mengbei chat room

I feel very good

This article will teach you to use pagodas to build a chat room

Introduce

Fiora The system is very simple , It also has many functions , be based on node.js, mongodb, react and socket.io Etc author : Shredded sauce   https://suisuijiang.com/ Github Address  https://github.com/yinxin630/fiora function Good friends , group , The private chat , Group chat text , picture , Code ,url And so on Post Bar expression , Funny expression , Search for expression packs Desktop notification , Voice alert , Voice Announcements Custom desktop background , Theme color , Text color view online users , The function of the little black room forbids

List of supplies

A Tencent cloud lightweight application server ( If the demand is not large, you can choose 1h1g, Yes 246 If so, just get started ) And install the pagoda Tencent cloud version

Begin to build

First, open the firewall 9200 port

Then we go backstage in the usual way , It is not necessary to install the recommended plug-ins , Go directly to the software store , install

Nginx 1.20 PM2 Manager MongoDB Redis 6.2

Then back to the console , Enter the command su Get into root Account

If you don't remember your password, you can reset it

Get into root Let's install it after the account git, Because some of them are not installed

yum -y install git

from GitHub Get the items directly and put them in the custom folder , Such as fiora

git clone https://github.com/yinxin630/fiora.git -b master /fiora

Or download it directly , Go to the pagoda and upload

https://github.com/yinxin630/fiora/archive/master.zip

Then we switch to the site directory

cd /fiora

Install dependency

npm i -g yarn
yarn

Let's move

npm run build:client
npm run move-dist

Last      start-up

npm start

Let's visit Website :9200

If you can't access it, you can go to the pagoda firewall

And then create a admin Account

To finish these , We'll come back ssh Look at the log userID

Console input command , Add him to the administrators group

First give node Make a soft link , Otherwise, it will fail to start later ln -sf $(which node) /usr/bin/node

Get users userid  such as admin

yarn script getUserId admin

Set up Administrator Replace the red content below with the one taken above Userid

export Administrator= Content  Port=9200

The following commands are copied into SSH Client running

cat > /etc/systemd/system/fiora.service <<EOF [Unit] Description=fiora After=network.target Wants=network.target

[Service] Type=simple PIDFile=/var/run/fiora.pid ExecStart=$(command -v npm) start WorkingDirectory=/opt/fiora Environment=NODE_ENV=production Administrator=$Administrator Port=$Port User=root Restart=on-failure RestartSec=42s

[Install] WantedBy=multi-user.target EOF

Set boot up systemctl start fiora

Enable service on power up systemctl enable fiora

Here we are , The chat room has been set up

There are many other functions , That's good

You can chat with your friends in the future

Add domain name inversion

Suddenly forget , At this time, the access address is still ip:9200 Well , We have to add a domain name

First, add a domain name to the advanced pagoda ( First analyze ), Address selection Fiora The catalog of

Then click the domain name , Options 【 Reverse proxy 】, Just set it up

really · end

原网站

版权声明
本文为[Diligent thinking]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/11/20211118100803801d.html