Skip to content

Instantly share code, notes, and snippets.

@chicks-net
Last active November 30, 2018 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chicks-net/b3bd80180941c3b542f6927967f44150 to your computer and use it in GitHub Desktop.
Save chicks-net/b3bd80180941c3b542f6927967f44150 to your computer and use it in GitHub Desktop.
dealing with netbox installation step 3 on centos 7

dealing with netbox installation step 3 on centos 7

The netbox installation step 3 is regretably Ubuntu-centric. The developer, Jeremey Stretch, seems to have no interest in remedying this anti-production oversight.

It looks like there is a healthy ansible role for netbox worth trying RSN.

Josphat Mutai's install instructions

Josphat Mutai has provided a complete replacement set of installation instructions for installing netbox on centos 7. This is very handy, but it could be better:

  • Josphat disables SELinux right off of the bat. "As we will be using custom TCP ports, it is recommended to disable or put SELinux in permissive mode unless you know how to work with the tool." That's more explanation than most people give, but it still seems a bit funky. I'm not trying to work around this yet. It might be easy.
  • Josphat also gives you the options of apache or nginx just as Jeremy did, but there's no mention of haproxy. Why wouldn't haproxy work nicely for this? Who knows? I'm not trying to work around this yet. It should be easy.
  • no https configuration
  • Both also recommend using supervisor which seems easy to avoid. I'm looking into doing this with the native systemd. See also askubuntu, steffen-lindner, and the top comment on this Hacker News discussion.

config highlights

  • gunicorn runs on 127.0.0.1:8001 with 3 workers
  • nginx runs on 80

/etc/nginx/conf.d/netbox.conf

server {
    listen 80;
    server_name netbox.telmate.cc;
    client_max_body_size 25m;

    location /static/ {
        alias /opt/netbox/netbox/static/;
    }

    location / {
        proxy_pass http://127.0.0.1:8001;
        proxy_set_header X-Forwarded-Host $server_name;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment