dit document beschrijft de installatie van Netbox
postgres: sudo -u postgres psql
CREATE DATABASE netbox;
controleer: \l
CREATE USER netbox WITH PASSWORD 'q2;kjp8bnz ng;iu';
controleer: \du
ALTER DATABASE netbox OWNER TO netbox;
controleer: \l
\connect netbox;
GRANT CREATE ON SCHEMA public TO netbox;
psql --username netbox --password --host localhost netbox
zie: :Redis
apt install -y git python3 python3-pip python3-venv python3-dev build-essential libxml2-dev libxslt1-dev libffi-dev libpq-dev libssl-dev zlib1g-dev
python3 -V
sudo mkdir -p /opt/netbox/ cd /opt/netbox/ git clone https://github.com/netbox-community/netbox.git .
adduser --system --group netbox chown --recursive netbox /opt/netbox/netbox/media/ (**deze bestaat niet in cloned repo!!!) chown --recursive netbox /opt/netbox/netbox/reports/ chown --recursive netbox /opt/netbox/netbox/scripts/
cd /opt/netbox/netbox/netbox/ cp configuration_example.py configuration.py
ALLOWED_HOSTS = ['*'] en regel de toegang via Firewall./opt/netbox/upgrade.sh
source /opt/netbox/venv/bin/activate
cd /opt/netbox/netbox python3 manage.py createsuperuser
= Webserver Gateway Interface: fucntie waarbij web servers requests forward naar achterliggende web applicaties of frameworks geschreven in Python.
cp /opt/netbox/contrib/gunicorn.py /opt/netbox/gunicorn.py
cp -v /opt/netbox/contrib/*.service /etc/systemd/system/ systemctl daemon-reload
systemctl enable --now netbox netbox-rq
systemctl status netbox.service
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ -keyout /etc/ssl/private/netbox.key \ -out /etc/ssl/certs/netbox.crt
sudo apt install -y apache2
cp /opt/netbox/contrib/apache.conf /etc/apache2/sites-available/netbox.conf
pas de severnaam aan, cfr ALLOWED_HOSTS
a2enmod ssl proxy proxy_http headers rewrite a2ensite netbox systemctl restart apache2