Extend installation docs to include RHEL/CentOS instructions #343

Closed
opened 2025-12-29 16:21:05 +01:00 by adam · 7 comments
Owner

Originally created by @jeremystretch on GitHub (Aug 9, 2016).

The installation docs currently assume a Debian-based Linux OS. We should annotate the equivalent commands for RHEL-based OSes as well.

Originally created by @jeremystretch on GitHub (Aug 9, 2016). The installation docs currently assume a Debian-based Linux OS. We should annotate the equivalent commands for RHEL-based OSes as well.
adam added the type: documentation label 2025-12-29 16:21:05 +01:00
adam closed this issue 2025-12-29 16:21:05 +01:00
Author
Owner

@systo commented on GitHub (Aug 9, 2016):

From my installation notes, please verify.

Assumptions

Install was done on a fresh install of centos 7 minimal. Install assumes no root password to enable sudo, or sudo enabled and your user added to group wheel.
To enable password auth for postgres, I used this: How-to Install and Use PostgreSQL on CentOS 7
To enable debian-esque server blocks for Nginx I used this: How to Set Up Nginx Server Blocks on CentOS 7

For the PostgreSQL portion enable the epel repos

sudo yum install -y epel-release
sudo yum install -y postgresql postgresql-server postgresql-libs postgresql-devel

For the Netbox installation portion

sudo yum install -y python27 python-devel git python-pip libxml2-devel libxslt-devel libffi-devel graphviz.x86_64 openssl-devel

EDIT: Added openssl-devel to the list, per #441, and per my notes, missed it in a remediation step

@systo commented on GitHub (Aug 9, 2016): _From my installation notes, please verify._ ## Assumptions Install was done on a fresh install of centos 7 minimal. Install assumes no root password to enable sudo, or sudo enabled and your user added to group wheel. To enable password auth for postgres, I used this: [How-to Install and Use PostgreSQL on CentOS 7](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-centos-7) To enable debian-esque server blocks for Nginx I used this: [How to Set Up Nginx Server Blocks on CentOS 7](https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-on-centos-7) ### For the PostgreSQL portion enable the epel repos sudo yum install -y epel-release sudo yum install -y postgresql postgresql-server postgresql-libs postgresql-devel ### For the Netbox installation portion sudo yum install -y python27 python-devel git python-pip libxml2-devel libxslt-devel libffi-devel graphviz.x86_64 openssl-devel _EDIT: Added openssl-devel to the list, per #441, and per my notes, missed it in a remediation step_
Author
Owner

@iamdadmin commented on GitHub (Aug 9, 2016):

I just installed it on CentOS 6, which was significantly more complicated than for 7, and would be happy to share notes if it will help.

@iamdadmin commented on GitHub (Aug 9, 2016): I just installed it on CentOS 6, which was significantly more complicated than for 7, and would be happy to share notes if it will help.
Author
Owner

@jeremystretch commented on GitHub (Aug 11, 2016):

Per #441, it looks like openssl-devel should be included as well, to ensure that the Cryptography Python package compiles.

@jeremystretch commented on GitHub (Aug 11, 2016): Per #441, it looks like `openssl-devel` should be included as well, to ensure that the Cryptography Python package compiles.
Author
Owner

@iamdadmin commented on GitHub (Aug 11, 2016):

Coming back to this with a couple of notes.

Postgres

CentOS 6 ships with PGSql 8.4 which is EoS and in fairness I'm not sure which version ships with CentOS 7. EPEL is a pretty standard addon for most CentOS builds however I'd probably suggest using the pgdg repo from PG themselves:

http://yum.postgresql.org/repopackages.php

I've got 9.5.x up and running quite happily with this.

CentOS 6 in general

  • Python version. CentOS 6.x requires the system version of Python to be 2.6.x for yum. Yum doesn't work against Python2.7 so you have to run sidealong. I did this using SCL; but you then get all kinds library and binary path issues. For me, I appended it to the end, and largely got around it by doing the build by specifying pip2.7 install and it worked.
  • As discussed above, the missing openssl-devel, it's not in by default on CentOS 6.
  • Due I think mostly to the path issues with python I struggled to get gunicorn/supervisord going. I believe they were trapped in the system default bin/library and I couldn't decipher/didn't want to really mess around with that in case I broke Yum, and I couldn't find a sane way to add it to the paths within the init.d scripts etc.
  • I ended up with mod_wsgi in Apache2.4, which works fine, but requires 'WSGIPythonPath' to be added into the global config i.e. not inside the vhost. I'm not sure how this would scale in anything other than a 'dedicated-to-netbox-only' hosting environment, and given I'm probably a fairly typical user, I stuff a few open source utilities on a box (or in my case, a postgresql master-slave cluster with mirrored apache config & applications in warm standby on the second box). The mod_wsgi project don't want to support WSGIPythonPath under a vhost, and instead suggest that the application should register it's own paths in the main script (to be clear, WSGIPythonPath refers to /opt/netbox/netbox assuming you installed it to default path, the same path gunicorn refers to).
  • You can run mod_wsgi under Apache2.2 but Apache2.4 is preferred by the project, and I'm using it because SCL provides PHP5.4+ linked against Apache2.4 but not Apache2.2 and I also needed PHP for other tools. In order to get Apache2.4 up and running, I essentially had to symlink all the bins from the SCL directories into the usual locations, and also /etc/httpd/ became a symlink.
  • To get mod_wsgi up and running, I used pip2.7 to install it and it just linked correctly against Apache2.4 after that.

In summary: it's quite a lot of faff, bypassing, upgrading system packages and general not-easy-to-maintain-ness. I'd probably recommend using a newer version of CentOS as a base; CentOS 6.x will be supported for another 3 - 4 years but the versions of key apps like Python, PHP, etc are not supported officially by their projects and it's going to cause a cascading headache for someone wanting to maintain the system.

@iamdadmin commented on GitHub (Aug 11, 2016): Coming back to this with a couple of notes. **Postgres** CentOS 6 ships with PGSql 8.4 which is EoS and in fairness I'm not sure which version ships with CentOS 7. EPEL is a pretty standard addon for most CentOS builds however I'd probably suggest using the pgdg repo from PG themselves: http://yum.postgresql.org/repopackages.php I've got 9.5.x up and running quite happily with this. **CentOS 6 in general** - Python version. CentOS 6.x requires the system version of Python to be 2.6.x for yum. Yum doesn't work against Python2.7 so you have to run sidealong. I did this using SCL; but you then get all kinds library and binary path issues. For me, I appended it to the end, and largely got around it by doing the build by specifying pip2.7 install and it worked. - As discussed above, the missing openssl-devel, it's not in by default on CentOS 6. - Due I think mostly to the path issues with python I struggled to get gunicorn/supervisord going. I believe they were trapped in the system default bin/library and I couldn't decipher/didn't want to really mess around with that in case I broke Yum, and I couldn't find a sane way to add it to the paths within the init.d scripts etc. - I ended up with mod_wsgi in Apache2.4, which works fine, but requires 'WSGIPythonPath' to be added into the global config i.e. not inside the vhost. I'm not sure how this would scale in anything other than a 'dedicated-to-netbox-only' hosting environment, and given I'm probably a fairly typical user, I stuff a few open source utilities on a box (or in my case, a postgresql master-slave cluster with mirrored apache config & applications in warm standby on the second box). The mod_wsgi project don't want to support WSGIPythonPath under a vhost, and instead suggest that the application should register it's own paths in the main script (to be clear, WSGIPythonPath refers to /opt/netbox/netbox assuming you installed it to default path, the same path gunicorn refers to). - You can run mod_wsgi under Apache2.2 but Apache2.4 is preferred by the project, and I'm using it because SCL provides PHP5.4+ linked against Apache2.4 but not Apache2.2 and I also needed PHP for other tools. In order to get Apache2.4 up and running, I essentially had to symlink all the bins from the SCL directories into the usual locations, and also /etc/httpd/ became a symlink. - To get mod_wsgi up and running, I used pip2.7 to install it and it just linked correctly against Apache2.4 after that. In summary: it's quite a lot of faff, bypassing, upgrading system packages and general not-easy-to-maintain-ness. I'd probably recommend using a newer version of CentOS as a base; CentOS 6.x will be supported for another 3 - 4 years but the versions of key apps like Python, PHP, etc are not supported officially by their projects and it's going to cause a cascading headache for someone wanting to maintain the system.
Author
Owner

@aoyawale commented on GitHub (Aug 16, 2016):

I can make a PR with the doc I made before. That PR I submitted before was before the docs got separated. I can just add the centos part in each doc if you want.

@aoyawale commented on GitHub (Aug 16, 2016): I can make a PR with the doc I made before. That PR I submitted before was before the docs got separated. I can just add the centos part in each doc if you want.
Author
Owner

@soulemike commented on GitHub (Aug 30, 2016):

Here is the commands I used to get NetBox and dependencies installed on CentOS 7. This isn't fully complete as the service responds with a 503, so I need to figure that out.

http://pastebin.com/jkF0RM6Q

@soulemike commented on GitHub (Aug 30, 2016): Here is the commands I used to get NetBox and dependencies installed on CentOS 7. This isn't fully complete as the service responds with a 503, so I need to figure that out. http://pastebin.com/jkF0RM6Q
Author
Owner

@jeremystretch commented on GitHub (Sep 26, 2016):

I've adapted @chagara's PR to include CentOS/RHEL instructions for installing PostgreSQL, Django, and NetBox. I'm going to leave the web server portion focused on Debian/Ubuntu because we're already including both nginx and Apache, and I don't want the documentation to become to cumbersome.

@jeremystretch commented on GitHub (Sep 26, 2016): I've adapted @chagara's PR to include CentOS/RHEL instructions for installing PostgreSQL, Django, and NetBox. I'm going to leave the web server portion focused on Debian/Ubuntu because we're already including both nginx and Apache, and I don't want the documentation to become to cumbersome.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#343