Skip to content

Commit

Permalink
Support nginx+uwsgi deployments.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote committed Sep 2, 2016
1 parent 50d4258 commit 55ebc35
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 175 deletions.
18 changes: 18 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
##### Notes for deploying on OpenSUSE

Install nginx, uwsgi, uwsgi-python3 packages (need server repo enabled).

Clone the repository to /srv/findingchart/appdata/ and chown -R nginx:nginx
Move config/findingchart.ini to /etc/uwsgi/vassals/ (uWSGI Emperor config file)
Move config/findingchart.conf to /etc/nginx/conf.d/ (nginx config file)

Open port 80 in the firewall by setting `FW_SERVICES_EXT_TCP="80"` in /etc/sysconfig/SuSEfirewall2

Enable and start services

```
systemctl enable nginx uwsgi
systemctl start nginx uwsgi
systemctl restart SuSEfirewall2
```

16 changes: 16 additions & 0 deletions config/findingchart.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
server {
listen 80;
server_name _, localhost;

location = /findingchart { rewrite ^ /findingchart/; }

location /findingchart/static {
alias /srv/findingchart/appdata/static;
}

location /findingchart/ {
uwsgi_pass unix:/srv/findingchart/uwsgi.sock;
uwsgi_param SCRIPT_NAME /findingchart;
include uwsgi_params;
}
}
15 changes: 15 additions & 0 deletions config/findingchart.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[uwsgi]
socket = /srv/findingchart/uwsgi.sock
chmod-socket = 775
chdir = /srv/findingchart/appdata
master = true
mount = /findingchart=findingchart.py
callable = app
uid = nginx
gid = nginx
processes = 1
threads = 1
plugins = python3,logfile
logger = file:/srv/findingchart/uwsgi.log
manage-script-name = true

File renamed without changes.
174 changes: 0 additions & 174 deletions make-pm-findingchart.py

This file was deleted.

2 changes: 1 addition & 1 deletion templates/input.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h1>Finding chart generator</h1>
var targetData = [];

function generateChart(t) {
var url = 'generate?survey='+t.survey+'&size='+t.size+'&outepoch='+t.outepoch+'&ra='+t.ra+'&dec='+t.dec+'&rapm='+t.rapm+'&decpm='+t.decpm+'&epoch='+t.epoch
var url = '{{ url_for('generate_chart') }}?survey='+t.survey+'&size='+t.size+'&outepoch='+t.outepoch+'&ra='+t.ra+'&dec='+t.dec+'&rapm='+t.rapm+'&decpm='+t.decpm+'&epoch='+t.epoch

var chartWidth = t.annotate ? 522 : 512;
var chartHeight = t.annotate ? 612 : 512;
Expand Down

0 comments on commit 55ebc35

Please sign in to comment.