[점프 투 장고] 4-10장 배포 질문입니다.
Nginx를 실행(sudo systemctl restart nginx)하닌깐 502 Bad Gateway가 뜹니다.
sudo nginx -t해서 설정파일에 오류 확인하면
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
문제없이 이렇게 뜹니다.
그래서 왜그런지 확인하려고 로그를 보닌깐
Failed to parse PID from file /run/nginx.pid: Invalid argument 502 Bad Gateway
이렇게 뜨더라구요.
검색해서 찾아보니 stackoverflow(https://stackoverflow.com/questions/42078674/nginx-service-failed-to-read-pid-from-file-run-nginx-pid-invalid-argument)에서는
- mkdir /etc/systemd/system/nginx.service.d
- printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf systemctl daemon-reload
- systemctl restart nginx
하라고 베스트 댓글이 있어서 따라하닌깐 mkdir할 때 Permission Denied가 뜹니다..
그래서 sudo를 줘서 mkdir해서 디렉토리를 만들었습니다.
그리고 printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf systemctl daemon-reload 하닌깐 -bash: /etc/systemd/system/nginx.service.d/override.conf: Permission denied
2번째 스텝도 Permission denied가 뜨네요..
이것도 sudo해서 계속 진행해도 괜찮을까요? (sudo 남용하면 나중에 문제 생길수 있다고 들었던 거 같습니다)
이것만 되면 배포될꺼 같은데..윈도우 OS만 사용해오다가 ubuntu써서 괜찮을지 불확실하네요.
빠딱 님 827
M 2020년 8월 18일 12:20 오후
1개의 답변이 있습니다. 1 / 1 Page
Permission Denied 가 발생한다면
아마도 점프 투 장고의 파일명이나 파일경로를 그대로 사용하지 않은 부분이 있을 것 같습니다.
특히 다음 파일을 다른 경로로 설정하신건 아닐까요?
/tmp/gunicorn.sock
박응용 님
2020년 8월 18일 3:53 오후