Partage
  • Partager sur Facebook
  • Partager sur Twitter

Impossible de démarrer nginx

    26 novembre 2015 à 12:43:04

    Bonjour,

    après avoir suivi ce tuto à la lettre au moment de redémarrer nginx avec les commande "service nginx stop" puis au moment au j'envoie "service nginx start" (oui je me complique la vie j'aurais pu faire "restart") le serveur me renvoie :

    root@vps-9919:~# service nginx start
    Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
    

    Donc je fais :

    root@vps-9919:/# systemctl status nginx.service -l
    ● nginx.service - A high performance web server and a reverse proxy server
       Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
       Active: failed (Result: exit-code) since Thu 2015-11-26 07:13:07 EST; 11s ago
      Process: 999 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process o                                                                                        n; (code=exited, status=1/FAILURE)
    
    Nov 26 07:13:07 vps-9919 systemd[1]: Starting A high performance web server and                                                                                         a reverse proxy server...
    Nov 26 07:13:07 vps-9919 nginx[999]: nginx: [emerg] "server" directive is not al                                                                                        lowed here in /etc/nginx/sites-enabled/rutorrent.conf:60
    Nov 26 07:13:07 vps-9919 nginx[999]: nginx: configuration file /etc/nginx/nginx.                                                                                        conf test failed
    Nov 26 07:13:07 vps-9919 systemd[1]: nginx.service: control process exited, code                                                                                        =exited status=1
    Nov 26 07:13:07 vps-9919 systemd[1]: Failed to start A high performance web serv                                                                                        er and a reverse proxy server.
    Nov 26 07:13:07 vps-9919 systemd[1]: Unit nginx.service entered failed state.
    


    Et aussi :

    root@vps-9919:/# journalctl -xn -l
    -- Logs begin at Thu 2015-11-26 06:27:39 EST, end at Thu 2015-11-26 07:13:07 EST. --
    Nov 26 07:03:40 vps-9919 systemd[1]: Unit nginx.service entered failed state.
    Nov 26 07:07:08 vps-9919 sshd[810]: Did not receive identification string from 91.229.20.5
    Nov 26 07:11:08 vps-9919 sshd[959]: Did not receive identification string from 91.229.20.5
    Nov 26 07:13:07 vps-9919 systemd[1]: Starting A high performance web server and a reverse proxy server...
    -- Subject: Unit nginx.service has begun with start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit nginx.service has begun starting up.
    Nov 26 07:13:07 vps-9919 systemd[1]: Failed to reset devices.list on /system.slice/nginx.service: No such file or directory
    Nov 26 07:13:07 vps-9919 nginx[999]: nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-enabled/rutorrent.conf:60
    Nov 26 07:13:07 vps-9919 nginx[999]: nginx: configuration file /etc/nginx/nginx.conf test failed
    Nov 26 07:13:07 vps-9919 systemd[1]: nginx.service: control process exited, code=exited status=1
    Nov 26 07:13:07 vps-9919 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
    -- Subject: Unit nginx.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit nginx.service has failed.
    --
    -- The result is failed.
    Nov 26 07:13:07 vps-9919 systemd[1]: Unit nginx.service entered failed state.
    



    Voilà sinon que dire d'autre... j'ai bien suivi tout le tuto.

    Merci d'avance.

    PS : J'ai essayé de reboot le serveur mais rien n'y fait.

    -
    Edité par RedouaneBenouar 26 novembre 2015 à 13:18:22

    • Partager sur Facebook
    • Partager sur Twitter
      26 novembre 2015 à 16:48:50

      Bonjour,

      Apparemment le problème vient de ton fichier nginx.conf.

      Vérifie que tu n'as pas fait d'erreur (genre faute de frappe) et sinon joint le ici pour qu'on regarde.

      • Partager sur Facebook
      • Partager sur Twitter
        27 novembre 2015 à 13:53:53

        user www-data;
        worker_processes auto;
        pid /var/run/nginx.pid;
        
        events {
            worker_connections 1024;
            use epoll; # gestionnaire d'  v  nements epoll (kernel 2.6+)
        }
        
        http {
            include /etc/nginx/mime.types;
            default_type  application/octet-stream;
        
            access_log /var/log/nginx/access.log combined;
            error_log /var/log/nginx/error.log error;
        
            sendfile on;
            keepalive_timeout 15;
            keepalive_disable msie6;
            keepalive_requests 100;
            tcp_nopush on;
            tcp_nodelay off;
            server_tokens off;
        
            gzip on;
            gzip_comp_level 5;
            gzip_min_length 512;
            gzip_buffers 4 8k;
            gzip_proxied any;
            gzip_vary on;
            gzip_disable "msie6";
            gzip_types
                text/css
                text/javascript
                text/xml
                text/plain
                text/x-component
                application/javascript
                application/x-javascript
                application/json
                application/xml
                application/rss+xml
                application/vnd.ms-fontobject
                font/truetype
                font/opentype
                image/svg+xml;
        
            include /etc/nginx/sites-enabled/*.conf;
        }
        
        • Partager sur Facebook
        • Partager sur Twitter
          19 juillet 2016 à 15:58:02

           
          I just noticed that there was an old conf file in /etc/nginx/sites-available and I think it was something to do with that - I've deleted it and it works. It would be nice to know how to have figured this out from logs though!
          • Partager sur Facebook
          • Partager sur Twitter

          Impossible de démarrer nginx

          × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
          × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
          • Editeur
          • Markdown