Skip to content

Installera NetBox på Rocky Linux 9

Cloud Infrastructure Expert
Installera NetBox på Rocky Linux 9

 

 

I den här guiden går vi igenom hur du installerar NetBox, ett verktyg för nätverksinfrastrukturhantering, på Rocky Linux 9. Denna installation kan vara särskilt användbar för användare av en VPS-server.

Förutsättningar

  • Rocky Linux 9 installerat på din server.
  • Root-åtkomst eller sudo-rättigheter.
  • En aktiv internetanslutning.
  • Python 3.8 eller högre installerat.
  • PostgreSQL installerat.
  • Redis installerat.

Steg 1: Uppdatera systemet

Öppna terminalen och kör följande kommando för att uppdatera systempaketen:

sudo dnf update -y

Steg 2: Installera nödvändiga beroenden

Kör följande kommando för att installera nödvändiga paket:

sudo dnf install -y git gcc python3-devel python3-pip postgresql postgresql-server redis

Steg 3: Ställ in PostgreSQL

Initiera PostgreSQL-databasen:

sudo postgresql-setup --initdb

Starta och aktivera PostgreSQL-tjänsten:

sudo systemctl start postgresql
sudo systemctl enable postgresql

Logga in på PostgreSQL och skapa en databas för NetBox:

sudo -u postgres psql
CREATE DATABASE netbox;
CREATE USER netbox WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE netbox TO netbox;
\q

Steg 4: Ladda ner NetBox

Klonar NetBox-repositoriet:

git clone -b master https://github.com/netbox-community/netbox.git /opt/netbox

Steg 5: Installera NetBox beroenden

Navigera till NetBox-mappen och installera beroenden:

cd /opt/netbox
pip3 install -r requirements.txt

Steg 6: Konfigurera NetBox

Kopiera exempelkonfigurationsfilen:

cp netbox/netbox/configuration.example.py netbox/netbox/configuration.py

Redigera konfigurationsfilen för att ställa in databasen:

nano netbox/netbox/configuration.py

Ändra följande rader för att matcha dina inställningar:

DATABASE = {
    'NAME': 'netbox',
    'USER': 'netbox',
    'PASSWORD': 'your_password',
}

Steg 7: Starta Redis-tjänsten

Kör följande kommando för att starta Redis:

sudo systemctl start redis
sudo systemctl enable redis

Steg 8: Starta NetBox med Gunicorn

Kör följande kommando för att starta NetBox med Gunicorn:

gunicorn --workers 3 --bind unix:/opt/netbox/netbox.sock netbox.wsgi:application

Steg 9: Åtkomst till NetBox-webbgränssnittet

Navigera till följande URL i din webbläsare för att komma åt NetBox:

http://your_server_ip:8000

Avslutning

Ditt NetBox-system är nu installerat och klart för användning. Genom att använda denna metod kan du enkelt hantera din nätverksinfrastruktur från en VPS-server.

Windows VPS Deutschland

Windows VPS España

Windows VPS Nederland

Windows VPS Italia

Windows VPS Portugal

VPS Windows Italia

Windows VPS

Windows VPS

Windows VPS Sverige

Windows VPS Norge

Windows VPS

Windows VPS Türkiye

Windows RDS (Remote Desktop Services)

Windows VPS

Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.