From 30e204219ab5358ad3e5c561d0c20ed8614a72c1 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 11 Mar 2021 11:59:16 -0500 Subject: [PATCH] Trying to make this work on my server. Testing... --- "\\" | 26 ++++++++++++++++++ admin/documentation/.run locally.txt.kate-swp | Bin 0 -> 863 bytes admin/documentation/setup_server.txt | 12 ++++++-- admin/requirements.txt | 1 + 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 "\\" create mode 100644 admin/documentation/.run locally.txt.kate-swp diff --git "a/\\" "b/\\" new file mode 100644 index 0000000..95a5909 --- /dev/null +++ "b/\\" @@ -0,0 +1,26 @@ +[Unit] +Description=gunicorn daemon +Requires=gunicorn.socket +After=network.target + +[Service] +Type=notify +# the specific user that our service will run as +User=root +Group=root +# another option for an even more restricted service is +# DynamicUser=yes +# see http://0pointer.net/blog/dynamic-users-with-systemd.html +RuntimeDirectory=gunicorn +WorkingDirectory=/home/scott/OSIT_dev/aether_api_fastapi +Environment="PATH=/home/scott/OSIT_dev/aether_api_fastapi/environment/bin" +#ExecStart=/home/scott/test/python_fastapi/environment/bin/gunicorn --workers 3 app.main:app +#ExecStart=/home/scott/test/python_fastapi/environment/bin/gunicorn --workers 1 -k uvicorn.workers.UvicornWorker --ws websockets --bind unix:/home/scott/test/python_fastapi/gunicorn.sock -m 007 app.main:app --reload +ExecStart=/home/scott/OSIT_dev/aether_api_fastapi/environment/bin/gunicorn --bind unix:/home/scott/OSIT_dev/aether_api_fastapi/gunicorn.sock --unmask 007 app.main:app --workers 2 --worker-class uvicorn.workers.UvicornWorker --access-logfile admin/log/access.log --error-logfile admin/log/error.log, --log-file admin/log/log.log --capture-output --keep-alive 5 --reload +ExecReload=/bin/kill -s HUP $MAINPID +KillMode=mixed +TimeoutStopSec=5 +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/admin/documentation/.run locally.txt.kate-swp b/admin/documentation/.run locally.txt.kate-swp new file mode 100644 index 0000000000000000000000000000000000000000..80b741b604ab671669f60cf2edc297e1587b7fd0 GIT binary patch literal 863 zcmeH_%}N6?5XZBApT!4=;L&VqMa14K6hXmNdJ*cFO}Ak`vLxB+8|Z6z@fCa*-#}3C z5u9{OqvFN8hh_f1%#VQ`h7huO0#4H87HWE|3Q4mt+ElUCBBzWsCD@#HI)@bMIxay~Jq*~m)h3t5((WQNQGm6ynYIJw zLVVfsaOR^7LP%>_p|i37b4W{7aU|Y0VvJ}>W3>52n!S5x7bPt0#}Is)PY_VM#z>|c zS2qsrT*{h3p{9}^AR1X{Nc+kE%Kp5vb3Cubm3`YFiL$_vzrrT)lIJS$vS$@|#j^;! U>RAU~^K1gId;T(S!!zxF0w2Qm=l}o! literal 0 HcmV?d00001 diff --git a/admin/documentation/setup_server.txt b/admin/documentation/setup_server.txt index e984173..3cef64d 100644 --- a/admin/documentation/setup_server.txt +++ b/admin/documentation/setup_server.txt @@ -23,12 +23,20 @@ sudo systemctl daemon-reload sudo systemctl enable gunicorn.socket sudo systemctl start gunicorn.socket sudo systemctl status gunicorn.socket +sudo systemctl status gunicorn.service -???sudo systemctl enable gunicorn.service??? -???sudo systemctl start gunicorn.service??? +# Do not: sudo systemctl enable gunicorn.service +# Do not? sudo systemctl start gunicorn.service sudo vim /etc/nginx/sites-available/dev_fastapi.oneskyit.com sudo ln -s /etc/nginx/sites-available/dev_fastapi.oneskyit.com /etc/nginx/sites-enabled/dev_fastapi.oneskyit.com sudo systemctl restart nginx.service sudo systemctl status nginx.service + +# Troubleshooting: +systemctl list-units --type=service --state=active +systemctl list-units --type=service --state=running + +sudo systemctl | grep running +sudo systemctl list-unit-files | grep enabled diff --git a/admin/requirements.txt b/admin/requirements.txt index 4f523ba..1cd12ad 100644 --- a/admin/requirements.txt +++ b/admin/requirements.txt @@ -8,3 +8,4 @@ aioredis html2text pytz #mypy +stripe