Fiora 二次元Web聊天室 寶塔搭建


1、安裝寶塔

#CentOS系統
wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
#Ubuntu系統
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh
#Debian系統
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh

安裝完成后,進入面板,點擊左側軟件商店,然后安裝 PM2管理器MongoDBNginx(使用域名訪問才需要安裝,反之不用)。

2、安裝fiora

Xshell 連接小雞后:

#拉取源碼並存放於/opt文件夾
git clone https://github.com/yinxin630/fiora.git -b master /opt/fiora
cd /opt/fiora
#安裝依賴,這里不能用npm,需要用yarn來安裝
npm i -g yarn
yarn
#構建
npm run build
#轉移產物
npm run move-dist
#啟動
npm start

運行后打開ip:9200,注冊一個賬號,然后可以看SSH客戶端運行日志,獲取自己的userId

 

 

 如果ip:9200打不開的,可以檢查下防火牆,CentOS系統可以使用以下命令:

#CentOS 6
iptables -I INPUT -p tcp --dport 9200 -j ACCEPT
service iptables save
service iptables restart

#CentOS 7
firewall-cmd --zone=public --add-port=9200/tcp --permanent
firewall-cmd --reload

接下來新建Systemd配置文件 ,再將自己的賬號設置成管理員,先使用Ctrl+C斷開運行。

#先給node做個軟連接,不然后面會啟動失敗
ln -sf $(which node) /usr/bin/node
#修改運行端口,可以默認
export Administrator=【替換你userID】 Port=9200 #以下命令一起復制進SSH客戶端運行 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

#設置開機啟動

systemctl start fiora

# 在開機時啟用服務
systemctl enable fiora

# 在開機時禁用服務

systemctl disable fiora

3、域名反代

1.寶塔面板里面,先點擊左側網站,添加站點,然后再點擊添加好了的域名

2.網址 - 域名 - 設置- 反向代理 - 增加反向代理

# 目標URL
http://127.0.0.1:9200

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM