[ubuntu] 우분투 파일 변경 시 gunicorn ngnix 재 실행 명령어

뚜니어리·2023년 7월 18일
0

Ubuntu

목록 보기
4/5

우분투 사용 시 파일이 변경되면 gunicorn 과 nginx를 재실행 해주어야한다.

gunicorn 재실행

pkill gunicorn
sudo systemctl restart gunicorn
nohup gunicorn --daemon config.wsgi &
nohup gunicorn --daemon <폴더이름 or 서버이름>.wsgi &

나는 장고를 주로 사용해서 포트번호가 0.0.0.0:8000 인거임

gunicorn config.wsgi:application --bind 0.0.0.0:8000 --daemon &

nginx 재실행

sudo service nginx restart
sudo service nginx reload
sudo nginx -t

ngnix 문법 검사까지 완료하기~!

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

ngnix 가 문제없다고 뜬 다면 성공 !

가끔 이렇게 문법오류는 없는데도 오류가 날 때가 있다.
그럴 땐 nginx 폴더 안에 conf 파일을 살펴보기 !
ngnix/available/ 안에 파일을 살펴봐야 할 수도 있음!

상황에 따라 맞게 설정해주면 됨 ~!

profile
삽질과 저장소의 그 중간

1개의 댓글

comment-user-thumbnail
2023년 7월 19일

좋은 글 잘 읽었습니다, 감사합니다.

답글 달기