Hur man installerar NodeBB med Nginx Proxy på Ubuntu 24.04 Server

 

Hur man installerar NodeBB med Nginx Proxy på Ubuntu 24.04 Server

NodeBB är en kraftfull open-source plattform för forum, utvecklad med Node.js. Den här guiden visar hur du installerar NodeBB på en Ubuntu 24.04-server, konfigurerar den med MongoDB och använder Nginx som en omvänd proxy.

Steg 1: Uppdatera systemet

Börja med att uppdatera paketlistan och uppgradera de installerade paketen. Öppna en terminal och kör följande kommandon:

sudo apt update && sudo apt upgrade -y

Steg 2: Installera nödvändiga paket

Installera nödvändiga beroenden, inklusive Git, Node.js, MongoDB och Nginx:

sudo apt install git curl nginx mongodb -y

Installera sedan Node.js genom att lägga till NodeSource-arkivet och därefter installera Node.js:

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install nodejs

Steg 3: Installera och konfigurera MongoDB

Starta MongoDB-tjänsten och se till att den startar automatiskt vid systemuppstart:

sudo systemctl start mongodb
sudo systemctl enable mongodb

Skapa en MongoDB-användare och databas för NodeBB:

mongo

use nodebb
db.createUser({user: "nodebbuser", pwd: "yourpassword", roles: ["readWrite"]})
exit
        

Steg 4: Installera NodeBB

Klon NodeBB-repositoriet och gå in i katalogen:

git clone -b v1.x.x https://github.com/NodeBB/NodeBB.git nodebb
cd nodebb

Installera NodeBB:s beroenden med npm:

npm install --production

Steg 5: Konfigurera NodeBB

Kör setup-skriptet för NodeBB för att konfigurera forumet:

./nodebb setup

Du kommer att bli ombedd att ange olika inställningar, såsom databasinformation, URL och administratörsdetaljer. Använd de MongoDB-uppgifter som du skapade tidigare.

Steg 6: Konfigurera Nginx som omvänd proxy

För att konfigurera Nginx som en omvänd proxy, skapa en konfigurationsfil för NodeBB:

sudo nano /etc/nginx/sites-available/nodebb

Lägg till följande konfiguration:


server {
    listen 80;

    server_name your_domain.com;

    location / {
        proxy_pass http://localhost:4567;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;

        proxy_redirect off;
    }
}
        

Aktivera konfigurationen och starta om Nginx:

sudo ln -s /etc/nginx/sites-available/nodebb /etc/nginx/sites-enabled/
sudo systemctl restart nginx

Steg 7: Starta NodeBB

Starta NodeBB med följande kommando:

./nodebb start

Nu kan du komma åt ditt NodeBB-forum genom att besöka din domän i webbläsaren.

Slutsats

Grattis! Du har framgångsrikt installerat NodeBB med Nginx proxy på din Ubuntu 24.04-server. Ditt forum är nu redo att användas. Om du använder en fjärransluten server, se till att din brandvägg och nätverksinställningar är korrekt konfigurerade för att tillåta extern åtkomst.



Windows VPS

Windows VPS UK

Windows VPS

VPS Windows

Serwer VPS Windows

VPS Windows Deutschland

Windows VPS Hosting

VPS Windows España

Windows VPS Nederland

VPS Windows Italia

VPS Windows Portugal

VPS Windows Россия

VPS Windows Украина

VPS Windows 日本

VPS Windows Sverige

VPS Windows Norge

VPS Windows عربى

VPS Windows Türkiye

Remote Desktop Services (RDS)

RDS CAL (Client Access License)

Remote Desktop VPS

Keywords: windows vps uk, windows vps, uk windows vps, windows vps hosting uk, vps windows server, uk vps windows, vps windows, servidor vps windows, vps uk windows, vps with windows, virtual private server windows, windows virtual private server, windows vps server uk, vps for windows, servidores vps windows, vps windows uk, windows vps hosting, vps windows hosting, windows vps server, windows virtual private servers, vps on windows, vps windows servers, cheap windows vps uk, windowsvps, windows desktop vps, buy vps windows, windows server vps, windows 10 vps uk, rds services, rds cal, remote desktop services, remote desktop hosting

#windowsvps #vpshosting #ukvps #virtualserver #windowsvpsuk #vpsserver #hostingvps #cloudvps #windowsvpshosting #cheapvps #vpswithwindows #windowsserver #servervps #vpssolutions #vpswindows #rdscal #remotedesktop #remotedesktopvps #rds #windowsrds

vps windows
  • 0 användare blev hjälpta av detta svar
Hjälpte svaret dig?

Relaterade artiklar

Boost Your Ubuntu System's Performance with a Swap File: A Step-by-Step Guide

What is a Swap File? A swap file in Ubuntu serves as dedicated virtual memory on your hard...

How to Migrate ISPConfig 2, ISPConfig 3.x, Confixx, CPanel or Plesk to ISPConfig 3.2 (single server)

Introduction Migration from other control panels like ISPConfig 2, ISPConfig 3.x, Confixx,...

How to Install and Configure Zabbix Server and Client on Rocky Linux 9

Introduction Zabbix is an open-source monitoring solution that provides real-time...

How to Install CockroachDB Cluster on Debian 12

Introduction CockroachDB is a distributed SQL database built to handle large-scale,...

How to Install Joomla with Apache and Let's Encrypt SSL on AlmaLinux 9

Introduction Joomla is a popular open-source content management system (CMS) used to build...