mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Merge pull request #529 from chagara/develop
Added centos/rhel installation
This commit is contained in:
commit
1ebba3ee26
@ -2,6 +2,8 @@
|
||||
|
||||
NetBox requires following system dependencies:
|
||||
|
||||
Debian/Ubuntu
|
||||
|
||||
* python2.7
|
||||
* python-dev
|
||||
* python-pip
|
||||
@ -12,9 +14,26 @@ NetBox requires following system dependencies:
|
||||
* libpq-dev
|
||||
* libssl-dev
|
||||
|
||||
Centos/RHEL
|
||||
|
||||
* python27
|
||||
* python-devel
|
||||
* git
|
||||
* python-pip
|
||||
* libxml2-devel
|
||||
* libxslt-devel
|
||||
* libffi-devel
|
||||
* graphviz
|
||||
* openssl-devel
|
||||
|
||||
### Debian/Ubuntu
|
||||
```
|
||||
# sudo apt-get install -y python2.7 python-dev python-pip libxml2-dev libxslt1-dev libffi-dev graphviz libpq-dev libssl-dev
|
||||
```
|
||||
## Centos/RHEL
|
||||
```
|
||||
# sudo yum install -y epel-release
|
||||
# sudo yum install -y python27 python-devel git python-pip libxml2-devel lbxslt-devel libffi-devel graphviz.x_86_64 openssl-devel
|
||||
|
||||
You may opt to install NetBox either from a numbered release or by cloning the master branch of its repository on GitHub.
|
||||
|
||||
@ -43,6 +62,7 @@ If `git` is not already installed, install it:
|
||||
|
||||
```
|
||||
# sudo apt-get install -y git
|
||||
# sudo yum install -y git
|
||||
```
|
||||
|
||||
Next, clone the **master** branch of the NetBox GitHub repository into the current directory:
|
||||
|
@ -4,13 +4,27 @@ NetBox requires a PostgreSQL database to store data. MySQL is not supported, as
|
||||
|
||||
The following packages are needed to install PostgreSQL with Python support:
|
||||
|
||||
Debian/Ubuntu
|
||||
|
||||
* postgresql
|
||||
* libpq-dev
|
||||
* python-psycopg2
|
||||
|
||||
Centos/RHEL
|
||||
|
||||
* postgresql
|
||||
* postgresql-server
|
||||
* postgresql-libs
|
||||
* postgresql-devel
|
||||
|
||||
Debian/Ubuntu
|
||||
```
|
||||
# sudo apt-get install -y postgresql libpq-dev python-psycopg2
|
||||
```
|
||||
Centos/RHEL
|
||||
```
|
||||
# sudo yum install postgresql postgresql-server postgresql-libs postgresql-devel
|
||||
```
|
||||
|
||||
# Configuration
|
||||
|
||||
|
@ -2,17 +2,28 @@
|
||||
|
||||
We'll set up a simple WSGI front end using [gunicorn](http://gunicorn.org/) for the purposes of this guide. For web servers, we provide example configurations for both [nginx](https://www.nginx.com/resources/wiki/) and [Apache](http://httpd.apache.org/docs/2.4). (You are of course free to use whichever combination of HTTP and WSGI services you'd like.) We'll also use [supervisord](http://supervisord.org/) to enable service persistence.
|
||||
|
||||
Debian/Ubuntu
|
||||
```
|
||||
# sudo apt-get install -y gunicorn supervisor
|
||||
```
|
||||
Centos/RHEL
|
||||
```
|
||||
# sudo yum install -y gunicorn supervisor
|
||||
```
|
||||
|
||||
## Option A: nginx
|
||||
|
||||
The following will serve as a minimal nginx configuration. Be sure to modify your server name and installation path appropriately.
|
||||
|
||||
Debian/Ubuntu
|
||||
|
||||
```
|
||||
# sudo apt-get install -y nginx
|
||||
```
|
||||
Centos/RHEL
|
||||
```
|
||||
# sudo yum install -y nginx
|
||||
```
|
||||
|
||||
Once nginx is installed, proceed with the following configuration:
|
||||
|
||||
@ -57,9 +68,16 @@ To enable SSL, consider this guide on [securing nginx with Let's Encrypt](https:
|
||||
|
||||
## Option B: Apache
|
||||
|
||||
Debian/Ubuntu
|
||||
|
||||
```
|
||||
# sudo apt-get install -y apache2
|
||||
```
|
||||
Centos/RHEL
|
||||
|
||||
```
|
||||
# sudo yum install -y httpd
|
||||
```
|
||||
|
||||
Once Apache is installed, proceed with the following configuration (Be sure to modify the `ServerName` appropriately):
|
||||
|
||||
@ -99,7 +117,7 @@ To enable SSL, consider this guide on [securing Apache with Let's Encrypt](https
|
||||
|
||||
# gunicorn Installation
|
||||
|
||||
Save the following configuration file in the root netbox installation path (in this example, `/opt/netbox/`) as `gunicorn_config.py`. Be sure to verify the location of the gunicorn executable (e.g. `which gunicorn`) and to update the `pythonpath` variable if needed.
|
||||
Save the following configuration file in the root netbox installation path (in this example, `/opt/netbox/`) as `gunicorn_config.py`. Be sure to verify the location of the gunicorn executable (e.g. `which gunicorn`) and to update the `pythonpath` variable if needed. If using centos/RHEL use the apache user instead of www-data.
|
||||
|
||||
```
|
||||
command = '/usr/bin/gunicorn'
|
||||
@ -109,6 +127,7 @@ workers = 3
|
||||
user = 'www-data'
|
||||
```
|
||||
|
||||
|
||||
# supervisord Installation
|
||||
|
||||
Save the following as `/etc/supervisor/conf.d/netbox.conf`. Update the `command` and `directory` paths as needed.
|
||||
|
Loading…
Reference in New Issue
Block a user