From 6669709e1e5fc189fdddf6518168234b9a1104d8 Mon Sep 17 00:00:00 2001 From: Alex Conrey Date: Mon, 27 Jun 2016 17:36:52 -0500 Subject: [PATCH 1/4] added apache virtualhost instructions --- docs/getting-started.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/getting-started.md b/docs/getting-started.md index 8f2688aef..3084231d9 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -256,6 +256,34 @@ Restart the nginx service to use the new configuration. # service nginx restart * Restarting nginx nginx ``` +## Apache Configuration + +If you're feeling adventurous, or you already have Apache installed and can't run a dual-stack on your server - an Apache configuration has been created: + +``` + + ProxyPreserveHost On + + ServerName netbox.totallycool.tld + + Alias /static/ /opt/netbox/static/static + + + Options Indexes FollowSymLinks MultiViews + AllowOverride None + Order allow,deny + Allow from all + #Require all granted [UNCOMMENT THIS IF RUNNING APACHE 2.4] + + + + ProxyPass ! + + + ProxyPass / http://127.0.0.1:8001; + ProxyPassReverse / http://127.0.0.1:8001; + +``` ## gunicorn Configuration From e05d902742a525f4b5e77ef68a11add7146b376a Mon Sep 17 00:00:00 2001 From: Alex Conrey Date: Mon, 27 Jun 2016 17:38:57 -0500 Subject: [PATCH 2/4] added apache virtualhost instructions --- docs/getting-started.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 3084231d9..19c53c0aa 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -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. -# nginx and gunicorn +# Web Server and gunicorn ## 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. ``` -# apt-get install nginx gunicorn supervisor +# apt-get install gunicorn supervisor ``` ## nginx Configuration 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 { listen 80; @@ -285,6 +291,12 @@ If you're feeling adventurous, or you already have Apache installed and can't ru ``` +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 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. From 0e97eaa3987d4f47ecec770067e6c49aa42c0e85 Mon Sep 17 00:00:00 2001 From: Alex Conrey Date: Mon, 27 Jun 2016 17:40:19 -0500 Subject: [PATCH 3/4] added apache virtualhost instructions --- docs/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 19c53c0aa..d81f0ac94 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -210,7 +210,7 @@ If the test service does not run, or you cannot reach the NetBox home page, some ## 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 [gunicorn](http://gunicorn.org/) for the purposes of this guide. For web servers, we have 2 configurations ready to go - we provide instructions 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/) for service persistence. ``` # apt-get install gunicorn supervisor From a33d5d1bc6cafca6bb0438a8fca6e420919018fe Mon Sep 17 00:00:00 2001 From: Alex Conrey Date: Mon, 27 Jun 2016 17:41:04 -0500 Subject: [PATCH 4/4] added apache virtualhost instructions --- docs/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index d81f0ac94..0dec52451 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -291,7 +291,7 @@ If you're feeling adventurous, or you already have Apache installed and can't ru ``` -Save the contents of the above example in /etc/apache2/sites-available/netbox.conf, add in the newly saved configuration and reload Apache: +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