Skip to content

Commit

Permalink
Add serving edx-adapt with uWSGI and Nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
idegtiarov committed Nov 24, 2016
1 parent 09610e7 commit 78dee0a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions adapt_wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from edx_adapt.api.adapt_api import app

if __name__ == "__main__":
app.run(port=8080)
13 changes: 13 additions & 0 deletions etc/edx_adapt/edx_adapt.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[uwsgi]
module = adapt_wsgi:app

master = true
processes = 5

socket = /tmp/edx_adapt.sock
chmod-socket = 660
vacuum = true

logger = file:/tmp/edx-adapt.log

die-on-term = true
18 changes: 18 additions & 0 deletions etc/init/edx_adapt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This config file could be added into /etc/init to start application as a daemon
description "uWSGI server instance configured to serve edx_adapt"

start on runlevel [2345]
stop on runlevel [!2345]

# IMPORTANT: All commented parameters are required and should be uncomment with correct values

# Config permissions for user_id and group_id
#setuid ubuntu
setgid www-data

# Config path to edx-adapt environment
#env PATH=/path/to/edx-adapt/env/bin

# Config path to edx-adapt working dir
#chdir /path/to/edx-adapt
exec uwsgi --ini /etc/edx_adapt/edx_adapt.ini
11 changes: 11 additions & 0 deletions etc/nginx/sites-available/edx_adapt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Add in location dict on /etc/nginx/sites-available/edx-adapt next parameters:

server {
listen 8080;
server_name server_name_or_ip_address;

location / {
include uwsgi_params;
uwsgi_pass unix:/tmp/edx_adapt.sock;
}
}

0 comments on commit 78dee0a

Please sign in to comment.