* 참고) oracle 클라우드에서는 os가 Oracle Linux 인데, 이 os는 RHEL(Redhat Enterprise Linux) 와 호환가능한 엔터프라이즈 os 플랙폼이다. oracle 클라우드 서버를 쓰는 중 os dependent 한 부분이 있을 때는 "rhel" 키워드로 검색하는게 더 정보가 많을듯하다.
문제
nginx 를 실행하려고 하면 Permission denied) while connecting to upstream
와 같은 에러가 뜬다.
원인
RHEL Linux 에서 사용하는 보안 관련 SELinux 설정 때문.
RHEL, Centos 에서는 enforce 모드가 디폴트라서 nginx 연결이 거부되었던 것.
SELinux docs : https://www.redhat.com/en/topics/linux/what-is-selinux
해결
SELinux 동작 모드를 disable 시킨다.
SELinux 해제하기
- 설정 파일
- RHEL/CentOS 8
vi /etc/selinux/config
- RHEL/CentOS 7 이전
vi /etc/sysconfig/selinux
SELINUX=enforcing
-->SELINUX=disabled
로 변경SELINUX=disabled
- reboot
참고 자료 : https://www.lesstif.com/system-admin/centos-selinux-6979732.html