[Khắc phục] Nginx Start Centos 7 – Nginx: [nổi lên] Open () “con đường” Không thành công (13: bị từ chối cho phép)

Về việc quản lý các máy chủ web, nhiều bất ngờ khó chịu có thể xảy ra. Đặc biệt là khi chuyển từ một phiên bản cũ hơn của một hệ điều hành, sang một phiên bản mới hơn. VSALABLE rất nhiều cho Ubuntu cũng như cho Centos.

Của Centos 5, Centos 7 Nhiều thứ đã thay đổi để tốt hơn. Sự nhấn mạnh là rất nhiều vào an ninh và ổn định. Đối với một người mới làm quen, hoặc cho người dùng không biết những gì xuất hiện mới về mặt máy chủ và siervics cụ thể để quản lý Lưu trữ web, Tin tức nhỏ có thể gây đau đầu.

Một trong những lỗi phổ biến nhất gặp phải khi cài đặt LEMP (Linux, Nginx, MySQL, PHP) Bảo mật và quyền của dịch vụ Được cài đặt trên hệ điều hành Centos 7.

Imposibilitatea de a porni serviciul NGINX chiar daca totul pare configurat bine din punct de vedere al PHP-FPM si 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.

In status avem urmatoarele detalii, dar care nu ne ajuta foarte mult.

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.

Intelegem totusi ca este blocat accesul serviciului “nginx” execute operatiuni pe CentOS 7.

Rezolvarea problemei “Nginx: [nổi lên] Open () “con đường” Không thành công (13: bị từ chối cho phép)”

Linux tăng cường bảo mật .Selinux) este un modul care de cele mai multe ori vine activat odata cu instalarea CentOS 7 sau a altor distributii de Linux. Acest modul ofera multiple instrumente de control si acces control la nivel de server, fiind un bun gardian cand vine vorba despre securitate si integritate. Cu toate acestea, poate limita privilegiile unor servicii si aplicatii importante, instalate pe sistem.

Rezolvarea simpla a problemei de mai sus, este dezactivarea SELinux.

Cum dezactivam SELinux pe CentOS 7

1. Trước hết, thật tốt khi kiểm tra xem mô -đun này có được kích hoạt trên hệ thống không “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. Daca serviciul este activat (enabled), executati linia de comanda: “setenforce 0”, apoi mergeti si editati fisierul “/etc/selinux/config”.
Aici setati : SELINUX=disabled.

3. Sau khi bạn đã lưu tệp ở trên, khởi động lại máy chủ.

Totul ar trebui sa functioneze fara probleme.

Đam mê về công nghệ, tôi viết với niềm vui trên sthealthsetts.com bắt đầu từ năm 2006. Tôi có trải nghiệm phong phú trong các hệ điều hành: MacOS, Windows và Linux, nhưng cũng trong các ngôn ngữ lập trình và nền tảng blog (WordPress) và cho các cửa hàng trực tuyến (WooC Commerce, Magento, Presashop).

Trang chủ Nguồn hướng dẫn của nó, các mẹo và tin tức hữu ích. [Khắc phục] Nginx Start Centos 7 – Nginx: [nổi lên] Open () “con đường” Không thành công (13: bị từ chối cho phép)

1 suy nghĩ về "[Khắc phục] Nginx Start Centos 7 – Nginx: [nổi lên] Open () “con đường” Không thành công (13: bị từ chối cho phép)”

Để lại một bình luận