0

I have installed netbox on an Ubuntu Server.
I have tested the netbox out using this command

python3 manage.py runserver 0.0.0.0:8000 --insecure

This works and I have left it running as a task in the background for now. It's not a permanent solution.

I was able to get the service running, as I am able to access it using

wget 127.0.0.1:8000

This is a local loopback address and I wanted to know how I can change this to the ip address of the server. I have tried to change the Server Address in the config but no luck

This is what the systemctl status looks like:

Nov 02 12:05:29 l systemd[1]: Started NetBox WSGI Service.
Nov 02 12:05:29 l gunicorn[2330166]: !!!
Nov 02 12:05:29 l gunicorn[2330166]: !!! WARNING: configuration file should have a valid Python extension.
Nov 02 12:05:29 l gunicorn[2330166]: !!!
Nov 02 12:05:29 l gunicorn[2330166]: [2020-11-02 12:05:29 +0000] [2330166] [INFO] Starting gunicorn 20.0.4
Nov 02 12:05:29 l gunicorn[2330166]: [2020-11-02 12:05:29 +0000] [2330166] [INFO] Listening at: http://127.0.0.1:8000 (2330166)
Nov 02 12:05:29 l gunicorn[2330166]: [2020-11-02 12:05:29 +0000] [2330166] [INFO] Using worker: sync
Nov 02 12:05:29 l gunicorn[2330195]: [2020-11-02 12:05:29 +0000] [2330195] [INFO] Booting worker with pid: 2330195

If someone could point me into the right direction in allowing me to access it from the network using the servers IP Address?

1 Answers1

1

Make sure you have installed Gunicorn for wsgi HTTP using pip:

pip3 install gunicorn

Please follow the official document for systemd service for netbox.

Reference link

Use httpd redirect the netbox into apache webserver it will listen the port 0.0.0.0:8085. You can access netbox with your IP for example your IP is 172.32.32.10 then in browser 172.32.32.10:8085

Before that Install apache web server yum install httpd -y copy the below config into /etc/httpd/conf.d/netbox.conf

systemctl start httpd
systemctl enable httpd

Note, the default port for netbox is 8001. It will be redirected to your apache webserver.

netbox.conf

Listen 8085
ProxyPreserveHost On
ServerName netbox.example.com
Alias /static /opt/netbox/netbox/static
   <Directory /opt/netbox/netbox/static>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Require all granted
   </Directory>
   <Location  /static>
        ProxyPass !
  </Location>

ProxyPass / http://127.0.0.1:8001/
ProxyPassReverse / http://127.0.0.1:8001/
Ck_7
  • 469
  • 7
  • 12