Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
weatherbox:dashboard:start [2017/05/11 01:52] tbyers |
weatherbox:dashboard:start [2021/09/19 21:59] (current) |
||
---|---|---|---|
Line 59: | Line 59: | ||
---- | ---- | ||
===== Dashboard Deployment ===== | ===== Dashboard Deployment ===== | ||
- | **Deploying the Dashboard on Server** | + | ====Deploying the Dashboard on Server==== |
- | * Follow the following steps to for deploying the dashboard on a server | + | **Follow the following steps to for deploying the dashboard on a server** |
- Install and Configure VirtualEnv and VirtualEnvWrapper | - Install and Configure VirtualEnv and VirtualEnvWrapper | ||
- sudo apt-get install python-pip (skip this if pip already installed) | - sudo apt-get install python-pip (skip this if pip already installed) | ||
Line 80: | Line 80: | ||
- sudo apt-get install python-dev | - sudo apt-get install python-dev | ||
- sudo pip install uwsgi | - sudo pip install uwsgi | ||
- | - quickly test uWSGI with: uwsgi --http :8080 --home /home/**user**/Env/dashboard --chdir /home/**user**/dashboard/dashboard -w dashboard.wsgi | + | - quickly test uWSGI with: uwsgi --http :8080 --home /home/**user**/Env/dashboard --chdir /home/**user**/dashboard/dashboard -w dashboard.wsgi (in the currently deployed dashboard, **user** is replaced with **control_tower**) |
- sudo mkdir -p /etc/uwsgi/sites | - sudo mkdir -p /etc/uwsgi/sites | ||
- cd /etc/uwsgi/sites | - cd /etc/uwsgi/sites | ||
Line 119: | Line 119: | ||
location = /favicon.ico { access_log off; log_not_found off; } | location = /favicon.ico { access_log off; log_not_found off; } | ||
location /static/ { | location /static/ { | ||
- | root /home/user/dashboard/dashboard; | + | root /home/**user**/dashboard/dashboard; |
} | } | ||
location / { | location / { | ||
include uwsgi_params; | include uwsgi_params; | ||
- | uwsgi_pass unix:/home/user/dashboard/dashboard/dashboard.sock; | + | uwsgi_pass unix:/home/**user**/dashboard/dashboard/dashboard.sock; |
} | } | ||
}</code> | }</code> | ||
- | - more | + | - sudo ln -s /etc/nginx/sites-available/dashboard /etc/nginx/sites-enabled |
+ | - Check syntax with: sudo service nginx configtest (if errors exist, fix before proceeding) | ||
+ | - sudo service nginx restart | ||
+ | - sudo systemctl start uwsgi | ||
+ | - To start uWSGI on reboot: sudo systemctl enable uwsgi | ||
+ | * Resources used: | ||
+ | * [[https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-14-04|How To Serve Django Applications with uWSGI and Nginx on Ubuntu]] | ||
+ | * [[https://serverfault.com/questions/775965/wiring-uwsgi-to-work-with-django-and-nginx-on-ubuntu-16-04|Wiring uWSGI to work with Django and nginx on Ubuntu 16.04]] | ||