mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
added apache virtualhost instructions
This commit is contained in:
parent
6669709e1e
commit
e05d902742
@ -206,20 +206,26 @@ Now if we navigate to the name or IP of the server (as defined in `ALLOWED_HOSTS
|
|||||||
|
|
||||||
If the test service does not run, or you cannot reach the NetBox home page, something has gone wrong. Do not proceed with the rest of this guide until the installation has been corrected.
|
If the test service does not run, or you cannot reach the NetBox home page, something has gone wrong. Do not proceed with the rest of this guide until the installation has been corrected.
|
||||||
|
|
||||||
# nginx and gunicorn
|
# Web Server and gunicorn
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
We'll set up a simple HTTP front end using [nginx](https://www.nginx.com/resources/wiki/) and [gunicorn](http://gunicorn.org/) for the purposes of this guide. (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/) for service persistence.
|
We'll set up a simple HTTP front end using [nginx](https://www.nginx.com/resources/wiki/) and [gunicorn](http://gunicorn.org/) for the purposes of this guide. (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/) for service persistence.
|
||||||
|
|
||||||
```
|
```
|
||||||
# apt-get install nginx gunicorn supervisor
|
# apt-get install gunicorn supervisor
|
||||||
```
|
```
|
||||||
|
|
||||||
## nginx Configuration
|
## nginx Configuration
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
```
|
||||||
|
# apt-get install nginx
|
||||||
|
```
|
||||||
|
|
||||||
|
Once nginx is installed, proceed with the following configuration:
|
||||||
|
|
||||||
```
|
```
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
@ -285,6 +291,12 @@ If you're feeling adventurous, or you already have Apache installed and can't ru
|
|||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Save the contents of the above example in /etc/apache2/sites-available/netbox.conf, add in the newly saved configuration and reload Apache:
|
||||||
|
|
||||||
|
```
|
||||||
|
# a2ensite netbox; service apache2 restart
|
||||||
|
```
|
||||||
|
|
||||||
## gunicorn Configuration
|
## gunicorn Configuration
|
||||||
|
|
||||||
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.
|
||||||
|
Loading…
Reference in New Issue
Block a user