Maison  >  Questions et réponses  >  le corps du texte

Centos 7 nginx ne démarre pas automatiquement lors du démarrage et la raison est introuvable

[root@localhost ~]# systemctl status nginx.service -l
● 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 二 2017-07-04 11:59:56 CST; 2h 20min ago
  Process: 1129 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
  Process: 1125 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)

7月 04 11:59:52 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
7月 04 11:59:56 localhost.localdomain nginx[1129]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
7月 04 11:59:56 localhost.localdomain nginx[1129]: nginx: [emerg] open() "/logs/adminchuxing.yunjiebao.cc.80.access.log" failed (13: Permission denied)
7月 04 11:59:56 localhost.localdomain nginx[1129]: nginx: configuration file /etc/nginx/nginx.conf test failed
7月 04 11:59:56 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited status=1
7月 04 11:59:56 localhost.localdomain systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
7月 04 11:59:56 localhost.localdomain systemd[1]: Unit nginx.service entered failed state.
7月 04 11:59:56 localhost.localdomain systemd[1]: nginx.service failed.

Les autorisations ont été entièrement accordées au propriétaire du processus nginx, pourquoi cela ne fonctionne-t-il toujours pas ?

[root@localhost ~]# ll /logs
总用量 56
-rwxrwxrwx. 1 www-data www-data 43890 6月  28 11:23 adminchuxing.yunjiebao.cc.80.access.log
-rwxrwxrwx. 1 www-data www-data   908 6月  26 17:30 chuxing.yunjiebao.cc.80.access.log
drwxrwxrwx. 2 www-data www-data  4096 7月   4 10:24 mfxxadmin
drwxrwxrwx. 2 www-data www-data  4096 7月   4 10:00 mfxxapi

Configuration du fichier nginx.conf :

[root@localhost nginx]# cat nginx.conf
user www-data vboxsf;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
    use epoll;
    worker_connections 51200;
    multi_accept on;
}

天蓬老师天蓬老师2639 Il y a quelques jours1471

répondre à tous(4)je répondrai

  • 阿神

    阿神2017-07-05 10:47:39

    chmod nginx:nginx -R adminchuxing.yunjiebao.cc.80.access.log

    répondre
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-07-05 10:47:39

    Toutes les autorisations utilisateur dans nginx.conf sont-elles activées ? ?
    Essayez de changer la valeur correspondant à l'utilisateur en root et voyez si cela peut démarrer

    répondre
    0
  • 高洛峰

    高洛峰2017-07-05 10:47:39

    nginx : [emerg] open() "/logs/adminchuxing.yunjiebao.cc.80.access.log" a échoué (13 : autorisation refusée)
    N'est-ce pas très clair ?

    répondre
    0
  • 我想大声告诉你

    我想大声告诉你2017-07-05 10:47:39

    Les autorisations de lecture et d'écriture pour les fichiers de configuration et les fichiers journaux ne sont pas accordées à l'utilisateur ou au groupe nginx à démarrage automatique

    répondre
    0
  • Annulerrépondre