Merge pull request #529 from chagara/develop

Added centos/rhel installation
This commit is contained in:
Jeremy Stretch 2016-09-26 12:05:19 -04:00 committed by GitHub
commit 1ebba3ee26
3 changed files with 59 additions and 6 deletions

View File

@ -2,6 +2,8 @@
NetBox requires following system dependencies: NetBox requires following system dependencies:
Debian/Ubuntu
* python2.7 * python2.7
* python-dev * python-dev
* python-pip * python-pip
@ -12,9 +14,26 @@ NetBox requires following system dependencies:
* libpq-dev * libpq-dev
* libssl-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 # 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. 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 apt-get install -y git
# sudo yum install -y git
``` ```
Next, clone the **master** branch of the NetBox GitHub repository into the current directory: Next, clone the **master** branch of the NetBox GitHub repository into the current directory:
@ -76,7 +96,7 @@ Move into the NetBox configuration directory and make a copy of `configuration.e
``` ```
Open `configuration.py` with your preferred editor and set the following variables: Open `configuration.py` with your preferred editor and set the following variables:
* ALLOWED_HOSTS * ALLOWED_HOSTS
* DATABASE * DATABASE
* SECRET_KEY * SECRET_KEY
@ -143,8 +163,8 @@ NetBox does not come with any predefined user accounts. You'll need to create a
# ./manage.py createsuperuser # ./manage.py createsuperuser
Username: admin Username: admin
Email address: admin@example.com Email address: admin@example.com
Password: Password:
Password (again): Password (again):
Superuser created successfully. Superuser created successfully.
``` ```

View File

@ -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: The following packages are needed to install PostgreSQL with Python support:
Debian/Ubuntu
* postgresql * postgresql
* libpq-dev * libpq-dev
* python-psycopg2 * python-psycopg2
Centos/RHEL
* postgresql
* postgresql-server
* postgresql-libs
* postgresql-devel
Debian/Ubuntu
``` ```
# sudo apt-get install -y postgresql libpq-dev python-psycopg2 # sudo apt-get install -y postgresql libpq-dev python-psycopg2
``` ```
Centos/RHEL
```
# sudo yum install postgresql postgresql-server postgresql-libs postgresql-devel
```
# Configuration # Configuration

View File

@ -1,18 +1,29 @@
# Web Server Installation # Web Server Installation
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. 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 # sudo apt-get install -y gunicorn supervisor
``` ```
Centos/RHEL
```
# sudo yum install -y gunicorn supervisor
```
## Option A: nginx ## Option A: nginx
The following will serve as a minimal nginx configuration. Be sure to modify your server name and installation path appropriately. 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 # sudo apt-get install -y nginx
``` ```
Centos/RHEL
```
# sudo yum install -y nginx
```
Once nginx is installed, proceed with the following configuration: Once nginx is installed, proceed with the following configuration:
@ -43,7 +54,7 @@ Save this configuration to `/etc/nginx/sites-available/netbox`. Then, delete `/e
``` ```
# cd /etc/nginx/sites-enabled/ # cd /etc/nginx/sites-enabled/
# rm default # rm default
# ln -s /etc/nginx/sites-available/netbox # ln -s /etc/nginx/sites-available/netbox
``` ```
Restart the nginx service to use the new configuration. Restart the nginx service to use the new configuration.
@ -57,9 +68,16 @@ To enable SSL, consider this guide on [securing nginx with Let's Encrypt](https:
## Option B: Apache ## Option B: Apache
Debian/Ubuntu
``` ```
# sudo apt-get install -y apache2 # 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): 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 # 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' command = '/usr/bin/gunicorn'
@ -109,6 +127,7 @@ workers = 3
user = 'www-data' user = 'www-data'
``` ```
# supervisord Installation # supervisord Installation
Save the following as `/etc/supervisor/conf.d/netbox.conf`. Update the `command` and `directory` paths as needed. Save the following as `/etc/supervisor/conf.d/netbox.conf`. Update the `command` and `directory` paths as needed.