본문 바로가기
DevSpace/Python | Django

gunicorn + nginx 명령어

by 반니루니 2022. 1. 11.
반응형

sudo systemctl daemon-reload

 #데몬 리로드

 

sudo systemctl start gunicorn # 작성한 서비스 실행

sudo systemctl enable gunicorn # 서버 재시작시 자동으로 실행

sudo systemctl status gunicorn.service  # 실행한 서비스 상태 보기

sudo systemctl stop gunicorn # 서비스 중지

sudo systemctl restart gunicorn # 서비스 재시작

 

실행확인

sudo systemctl status gunicorn.service ( 작성한 파일명마다 다름)

 

<gunicorn service>

==========================================

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=hoon
Group=www-data
WorkingDirectory=/home/hoon/project1/djangoenv/startapp
ExecStart=/home/hoon/project1/djangoenv/bin/gunicorn \
        --workers 1 \
        --bind unix:/home/hoon/project1/djangoenv/startapp/run/gunicorn.sock \
        startapp.wsgi:application

[Install]
WantedBy=multi-user.target

===========================================

 

nginx 연동

 

service nginx status

 

 

 

반응형

'DevSpace > Python | Django' 카테고리의 다른 글

[python] 1.파이썬 설치하기  (0) 2022.02.16
[django] django-debug-toolbar + django-extensions 설치 및 에러 처리  (0) 2022.01.25
[django]web 실행시켜보기  (0) 2022.01.06
[ubuntu-django]  (0) 2022.01.06
[Django]명령어  (0) 2019.12.05