forked from joerunde/edx-adapt
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add serving edx-adapt with uWSGI and Nginx
- Loading branch information
1 parent
09610e7
commit 78dee0a
Showing
4 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |