NetBox installation on CentOS 8

1,112 views
Skip to first unread message

David Templeton

unread,
Jun 24, 2020, 12:57:13 PM6/24/20
to NetBox
Can someone share their success story for installing NetBox on CentOS 8? 

I'm stuck on the HTTP Server Setup section. Both Apache and nginx seem to work differently in CentOS 8. The sites-available folder, for example, doesn't exist for either. All I can get is a Bad Request (400) message when I try to connect.

Thanks.

João Lucas B. Macedo

unread,
Jun 24, 2020, 5:11:26 PM6/24/20
to David Templeton, NetBox
You must create a "netbox.conf" file inside the "/etc/httpd/conf.d/" folder.

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/52f9a666-3c1a-4619-aab3-ec11bbfd846fn%40googlegroups.com.


--
João Lucas Macedo

David Templeton

unread,
Jun 25, 2020, 10:51:48 AM6/25/20
to NetBox
Thank you all who replied. Tow issues were at the heart of my problem: a test Ubuntu server with the same name, and the nginx service was not started.

The nginx installation worked with these steps:

# added this while troubleshooting and decided to keep it:
setsebool -P httpd_can_network_connect 1

mkdir -p /etc/ssl/private

openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout /etc/ssl/private/netbox.key \
-out /etc/ssl/certs/netbox.crt

dnf install nginx

cp /opt/netbox/contrib/nginx.conf /etc/nginx/conf.d/netbox.conf

vi /etc/nginx/conf.d/netbox.conf
# change server_name to netbox.mydomain.com

vi /etc/nginx/nginx.conf
# comment out server section

systemctl start nginx
systemctl enable nginx

cd /opt/netbox
cp contrib/gunicorn.py /opt/netbox/gunicorn.py

cp contrib/*.service /etc/systemd/system/

systemctl daemon-reload
systemctl start netbox netbox-rq
systemctl enable netbox netbox-rq

# verify:
systemctl status nginx
systemctl status netbox


The Apache install worked well too. Replace the nginx steps with these:

dnf install httpd mod_ssl
cp /opt/netbox/contrib/apache.conf /etc/httpd/conf.d/netbox.conf
vi /etc/httpd/conf.d/netbox.conf
# change server_name to netbox.mydomain.com

systemctl start httpd
systemctl enable httpd
systemctl status httpd

davide Colombo

unread,
Jun 25, 2020, 11:05:34 AM6/25/20
to NetBox
Hi David, in the attachment you can find the procedure I've written, it was originally designed to migrate my previous environment to the new vm and it included many custom parts I've deleted, so i hope I'didn't delete anything from the 'standard procedure'
netbox_cos8_install.txt

Susan Short

unread,
Jul 26, 2020, 4:25:55 AM7/26/20
to NetBox
I got further, now it is working to localhost but not from an external host.  I renamed the netbox site file to netbox.conf and put it under conf.d and I saved a copy of nginx.conf in nginx.conf.orig but copied nginx.conf.default to nginx.conf.  The nginx.conf file is setup to work out of the box but it has the server definition in it.  It is a bit of a hack since I am just in POC right now.
Reply all
Reply to author
Forward
0 new messages