[FIX] NGINX 시작 실패 CentOS 7 - nginx: [emer] 열기() "경로" 실패(13: 권한 거부됨)

웹 서버 관리에 관한 한 불쾌한 놀라움이 많이 나타날 수 있습니다. 특히 이전 버전의 운영 체제에서 최신 버전으로 이동할 때 그렇습니다. 둘 다 가능 Ubuntu 과에 대한 CentOS.

부터 CentOS 5 년 CentOS 7 많은 것들이 더 좋게 바뀌었습니다. 보안과 안정성에 중점을 두었습니다. 를 위해 linux 초보자 또는 관리에 특정한 서버 및 서비스 측면에서 새로운 사항을 알지 못하는 사용자를 위한 것입니다. 웹 호스팅, 작은 소식은 당신에게 두통을 줄 수 있습니다.

LEMP를 설치할 때 발생하는 가장 일반적인 오류 중 하나(Linux, NGINX, MySQL, PHP) 보안 및 서비스 권한 운영 체제에 설치된 CentOS 7.

PHP-FPM과 NGINX의 관점에서 모든 것이 잘 구성되어 있다고해도 NGINX 서비스를 시작하지 못합니다.

restart nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

우리는 다음과 같은 세부 사항을 지니고 있으나 우리에게 많은 도움이되지 않습니다.

systemctl status nginx.service
 ● nginx.service - The nginx HTTP and reverse proxy server
 Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
 Active: failed (Result: exit-code) since Fri 2019-03-08 06:57:41 UTC; 17s ago
 Process: 4405 ExecReload=/bin/kill -s HUP $MAINPID (code=exited, status=0/SUCCESS)
 Process: 4704 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
 Process: 4766 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
 Process: 4764 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 4706 (code=exited, status=0/SUCCESS)
 Mar 08 06:57:40 srv.xsystem.dev systemd[1]: Starting The nginx HTTP and reverse proxy server...
 Mar 08 06:57:41 srv.xsystem.dev nginx[4766]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
 Mar 08 06:57:41 srv.xsystem.dev nginx[4766]: nginx: [emerg] open() "/srv/www/web.dev/logs/access.log" failed (13: Permission denied)
 Mar 08 06:57:41 srv.xsystem.dev nginx[4766]: nginx: configuration file /etc/nginx/nginx.conf test failed
 Mar 08 06:57:41 srv.xsystem.dev systemd[1]: nginx.service: control process exited, code=exited status=1
 Mar 08 06:57:41 srv.xsystem.dev systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
 Mar 08 06:57:41 srv.xsystem.dev systemd[1]: Unit nginx.service entered failed state.
 Mar 08 06:57:41 srv.xsystem.dev systemd[1]: nginx.service failed.

그러나 "nginx" 서비스에 대한 액세스가 차단된다는 점을 이해합니다. CentOS 7.

"nginx : [emer] open ()"경로 "실패 (13 : 권한 거부 됨)"문제 해결

보안 강화 Linux (SELinux)는 설치와 함께 가장 자주 활성화되는 모듈입니다. CentOS 7 또는 기타 배포판 Linux. 이 모듈은 여러 제어 도구 및 제어 액세스 서버 수준에서 좋은 경비가 될 때 보안 및 무결성. 그러나, 중요한 서비스 및 응용 프로그램의 권한을 제한 할 수 있습니다., 시스템에 설치되어 있습니다.

위 문제에 대한 간단한 해결책은 이를 비활성화하는 것입니다. SELinux.

비활성화하는 방법 SELinux pe CentOS 7

1. 먼저, 명령을 실행하여 시스템에서이 모듈이 활성화되어 있는지 확인하십시오 “sestatus”.

 SELinux status:                 enabled
 SELinuxfs mount:                /sys/fs/selinux
 SELinux root directory:         /etc/selinux
 Loaded policy name:             targeted
 Current mode:                   enforcing
 Mode from config file:          enforcing
 Policy MLS status:              enabled
 Policy deny_unknown status:     allowed
 Max kernel policy version:      31

2. 서비스가 활성화 된 경우 "setenforce 0"명령 줄을 실행 한 다음 이동하여 파일을 편집합니다. “/etc/selinux/config”.
여기 설정 :  SELINUX=disabled.

3. 위 파일을 저장한 후 서버를 재시작합니다.

모든 것이 원활하게 이루어져야합니다.

기술에 대한 열정, 나는 기쁨으로 글을 씁니다. StealthSettings2006년부터 .com을 운영하고 있습니다. 저는 운영 체제 분야에서 폭넓은 경험을 갖고 있습니다. macOS, Windows 과 Linux, 프로그래밍 언어 및 블로그 플랫폼(WordPress) 및 온라인 상점의 경우(WooCommerce, 마젠토, 프레스타샵).

방법 » 주목할만한 » [FIX] NGINX 시작 실패 CentOS 7 - nginx: [emer] 열기() "경로" 실패(13: 권한 거부됨)

"[FIX] NGINX 시작 실패에 대한 1개의 생각 CentOS 7 – nginx: [emerg] open() "경로" 실패(13: 권한 거부)"

  1. 나는 문제를 해결하기 위해 며칠 동안 노력했습니다. 귀하의 공헌에 대단히 감사합니다 !!

    댓글
코멘트 남김