-
Python) Flask+Gunicorn+Nginx 설치 (참고 자료)Programing Language/Python 2020. 12. 2. 01:25728x90반응형
How To Serve Flask Applications with Gunicorn and Nginx on Ubuntu | DigitalOcean
In this guide, you will build a Python application using the Flask microframework on Ubuntu 18.04. The bulk of this article will be about how to set up the Gunicorn application server and how to launch the application and configure Nginx to act as a f
www.digitalocean.com
nano /etc/systemd/system/myproject.service
작업할때
[Service] User=sammy Group=www-data WorkingDirectory=/home/sammy/myproject Environment="PATH=/home/sammy/myproject/myprojectenv/bin" ExecStart=/home/sammy/myproject/myprojectenv/bin/gunicorn --workers 3 --bind unix:myproject.sock -m 007 wsgi:app
부분에서 myproject 폴더의 위치를 자신의 리눅스 위치에 잘맞게 설정한다.
(참고 명령어 myproject위치에저 pwd)
Step 5 까지 완료후 502 bad Gatway가 뜬다면 /etc/nginx/nginx.conf 에 user를 root로 변경 하면된다.
728x90반응형'Programing Language > Python' 카테고리의 다른 글
Python) Numpy 2차원 배열 만들고 값 추가하는 방법 (0) 2021.07.23 Flask) 서버 재설정(기존 설치 이후 도메인 바뀌었을때) (0) 2021.03.18 Python) Multiple-Color-Detection-in-Real-Time-using-Python-OpenCV (0) 2021.01.04 Python) Flask에 FinanceDataReader 모듈 설치하기 (0) 2020.12.14 Python) Flask 서버 작업후 업데이트 하는방법 (0) 2020.12.13