Рет қаралды 841
Here is the transcript of the HowTo....
Netbox Install in Debian
apt -y update
apt -y install postgresql postgresql-common
systemctl is-enabled postgresql
systemctl status postgresql
sudo -u postgres psql
CREATE DATABASE netboxdb;
CREATE USER netbox WITH ENCRYPTED PASSWORD 'my_NetBox_Rocks';
GRANT ALL PRIVILEGES ON DATABASE netboxdb TO netbox;
\conninfo
\q
sudo -u postgres psql --username netbox --password --host localhost netboxdb
apt -y install redis-server
systemctl is-enabled redis-server
systemctl status redis-server
vi /etc/redis/redis.conf
requirepass RedisPasswordNetBox
systemctl restart redis-server
redis-cli
AUTH RedisPasswordNetBox
Ctl+d
useradd -r -d /opt/netbox -s /usr/sbin/nologin netbox
apt -y install -y git python3 python3-pip python3-venv python3-dev build-essential libxml2-dev libxslt1-dev libffi-dev libpq-dev libssl-dev zlib1g-dev
mkdir -p /opt/netbox && cd /opt/netbox
git clone -b master --depth 1 github.com/net... .
chown -R netbox:netbox /opt/netbox
cd /opt/netbox/netbox/netbox
sudo -u netbox cp configuration_example.py configuration.py
vi configuration.py
Update Hosts, DB/Pwd, Key, Redis Pwd
python3 ../generate_secret_key.py
cd /opt/netbox
sudo -u netbox pip3 install -r /opt/netbox/requirements.txt
sudo -u netbox /opt/netbox/upgrade.sh
source /opt/netbox/venv/bin/activate
cd /opt/netbox/netbox
python3 manage.py createsuperuser
exit
su -
sudo ln -s /opt/netbox/contrib/netbox-housekeeping.sh /etc/cron.daily/netbox-housekeeping
source /opt/netbox/venv/bin/activate
cd /opt/netbox/netbox
python3 manage.py runserver 0.0.0.0:8000 --insecure
exit
cp /opt/netbox/contrib/gunicorn.py /opt/netbox/gunicorn.py
cp -v /opt/netbox/contrib/*.service /etc/systemd/system/
systemctl daemon-reload
systemctl start netbox netbox-rq
systemctl enable netbox netbox-rq
systemctl status netbox-rq
systemctl status netbox
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout /etc/ssl/private/netbox.key \
-out /etc/ssl/certs/netbox.crt
apt -y install nginx
cp /opt/netbox/contrib/nginx.conf /etc/nginx/sites-available/netbox
rm /etc/nginx/sites-enabled/default
ln -s /etc/nginx/sites-available/netbox /etc/nginx/sites-enabled/netbox
nginx -t
systemctl restart nginx
systemctl status nginx
Netbox Install in Alma Linux
• Install Netbox in Alma...