gunicorn + nginx 명령어
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