diff --git a/adapt_wsgi.py b/adapt_wsgi.py new file mode 100644 index 0000000..3467d92 --- /dev/null +++ b/adapt_wsgi.py @@ -0,0 +1,4 @@ +from edx_adapt.api.adapt_api import app + +if __name__ == "__main__": + app.run(port=8080) diff --git a/etc/edx_adapt/edx_adapt.ini b/etc/edx_adapt/edx_adapt.ini new file mode 100644 index 0000000..1117ec0 --- /dev/null +++ b/etc/edx_adapt/edx_adapt.ini @@ -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 diff --git a/etc/init/edx_adapt.conf b/etc/init/edx_adapt.conf new file mode 100644 index 0000000..a30db9e --- /dev/null +++ b/etc/init/edx_adapt.conf @@ -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 diff --git a/etc/nginx/sites-available/edx_adapt b/etc/nginx/sites-available/edx_adapt new file mode 100644 index 0000000..5262c08 --- /dev/null +++ b/etc/nginx/sites-available/edx_adapt @@ -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; + } +}