Unable to restart nginxNginx installation error in Ubuntu 16.04smbd (samba daemon) does not listen on ports 139/445Nginx failed question programs not downloadingFailed to start raise network interface on Ubuntu 16.04Install Redis-Server on Ubuntu 16.04 LTS minimalsite inaccesible when i run a vhostUbuntu 18.04 Error with apache2nginx not restarting

At what point can you walk out of a restaurant if they make you wait to pay the bill?

SpaceX Starship landing on Moon or Mars: why doesn't it fall over?

Had J. K. Rowling seen This Is Spinal Tap before writing Harry Potter and the Philosopher's Stone?

Phrase: the sun is out

How to handle a supposedly corrupt boot partition?

What's the origin of the trope that dragons used to be common but aren't any more?

Wood glue versus epoxy for doweling stripped screw holes

Best way to drill square tubing (Without drill press)

How to write 2**n - 1 as a recursive function?

How to get previous command without arrow key

"Push chord". What's that?

Is this really played by 2200+ players?

Would fantasy dwarves be able to invent and/or manufacture the radio?

How to delete music as it's being played

Why doesn't the nucleus have "nucleus-probability cloud"?

Is there a name for the phenomenon of false positives counterintuitively outstripping true positives

If equal temperament divides an octave into 12 equal parts, why are the hertz differences not the same but 12ths of two?

What happened to SEV?

Copying files: Does Windows write to disk if files are identical

Why are telemedicine services regional?

Response to referee after rejection

Bass - describe attacking one note in one or more bars

Heat-shrink tubing available as a roll like adhesive tape?

What is Noita downloading every time I quit the game?



Unable to restart nginx


Nginx installation error in Ubuntu 16.04smbd (samba daemon) does not listen on ports 139/445Nginx failed question programs not downloadingFailed to start raise network interface on Ubuntu 16.04Install Redis-Server on Ubuntu 16.04 LTS minimalsite inaccesible when i run a vhostUbuntu 18.04 Error with apache2nginx not restarting






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0

















I need to restart the process. What do I do when I keep seeing these messages? Do you need more commands?



$ nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()

$ service nginx start
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 - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-05-29 13:28:29 KST; 26s ago
Process: 24508 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
Process: 31955 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 31952 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 13077 (code=exited, status=0/SUCCESS)

May 29 13:28:27 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
May 29 13:28:27 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
May 29 13:28:28 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
May 29 13:28:28 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
May 29 13:28:29 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
May 29 13:28:29 ip-172-26-12-170 nginx[31955]: nginx: [emerg] still could not bind()
May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Control process exited, code=exited status=1
May 29 13:28:29 ip-172-26-12-170 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Unit entered failed state.
May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Failed with result 'exit-code'.









share|improve this question


































    0

















    I need to restart the process. What do I do when I keep seeing these messages? Do you need more commands?



    $ nginx
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] still could not bind()

    $ service nginx start
    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 - A high performance web server and a reverse proxy server
    Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Wed 2019-05-29 13:28:29 KST; 26s ago
    Process: 24508 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
    Process: 31955 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
    Process: 31952 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Main PID: 13077 (code=exited, status=0/SUCCESS)

    May 29 13:28:27 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    May 29 13:28:27 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    May 29 13:28:28 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    May 29 13:28:28 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    May 29 13:28:29 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    May 29 13:28:29 ip-172-26-12-170 nginx[31955]: nginx: [emerg] still could not bind()
    May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Control process exited, code=exited status=1
    May 29 13:28:29 ip-172-26-12-170 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
    May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Unit entered failed state.
    May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Failed with result 'exit-code'.









    share|improve this question






























      0












      0








      0








      I need to restart the process. What do I do when I keep seeing these messages? Do you need more commands?



      $ nginx
      nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      nginx: [emerg] still could not bind()

      $ service nginx start
      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 - A high performance web server and a reverse proxy server
      Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
      Active: failed (Result: exit-code) since Wed 2019-05-29 13:28:29 KST; 26s ago
      Process: 24508 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
      Process: 31955 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
      Process: 31952 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
      Main PID: 13077 (code=exited, status=0/SUCCESS)

      May 29 13:28:27 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      May 29 13:28:27 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      May 29 13:28:28 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      May 29 13:28:28 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      May 29 13:28:29 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      May 29 13:28:29 ip-172-26-12-170 nginx[31955]: nginx: [emerg] still could not bind()
      May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Control process exited, code=exited status=1
      May 29 13:28:29 ip-172-26-12-170 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
      May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Unit entered failed state.
      May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Failed with result 'exit-code'.









      share|improve this question

















      I need to restart the process. What do I do when I keep seeing these messages? Do you need more commands?



      $ nginx
      nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      nginx: [emerg] still could not bind()

      $ service nginx start
      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 - A high performance web server and a reverse proxy server
      Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
      Active: failed (Result: exit-code) since Wed 2019-05-29 13:28:29 KST; 26s ago
      Process: 24508 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
      Process: 31955 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
      Process: 31952 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
      Main PID: 13077 (code=exited, status=0/SUCCESS)

      May 29 13:28:27 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      May 29 13:28:27 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      May 29 13:28:28 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      May 29 13:28:28 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      May 29 13:28:29 ip-172-26-12-170 nginx[31955]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
      May 29 13:28:29 ip-172-26-12-170 nginx[31955]: nginx: [emerg] still could not bind()
      May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Control process exited, code=exited status=1
      May 29 13:28:29 ip-172-26-12-170 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
      May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Unit entered failed state.
      May 29 13:28:29 ip-172-26-12-170 systemd[1]: nginx.service: Failed with result 'exit-code'.






      server nginx






      share|improve this question
















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 29 at 8:45









      noeppi noeppi

      1034 bronze badges




      1034 bronze badges










      asked May 29 at 4:31









      YangeokYangeok

      1




      1























          2 Answers
          2






          active

          oldest

          votes


















          0


















          A application is currently listening on the on port 80. Most likely it is a other instance of nginx.



          Find application that is listening on the socket



          With the netstat command you can find the application which is currently listening on the socket. Also use grep to filter the output of netstat.



          $ netstat -lpn | grep 80
          tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 780/nginx: master p
          tcp6 0 0 :::80 :::* LISTEN 780/nginx: master p


          The last entry of the list 780/nginx tells you the PID of the process currently listening on the port 80.



          Find and kill the application



          With ps you can see the process structure of the process using the socket:



          $ ps f -g780
          PID TTY STAT TIME COMMAND
          780 ? Ss 0:00 nginx: master process nginx
          781 ? S 0:00 _ nginx: worker process
          782 ? S 0:00 _ nginx: worker process
          783 ? S 0:00 _ nginx: worker process
          784 ? S 0:00 _ nginx: worker process
          785 ? S 0:00 _ nginx: worker process
          786 ? S 0:00 _ nginx: worker process
          787 ? S 0:00 _ nginx: worker process
          788 ? S 0:00 _ nginx: worker process


          With the kill command you can now terminate the process which uses the socket:



          $ kill 780


          If that does not terminate the process with -9:



          $ kill -9 780


          Then try to restart your nginx service.






          share|improve this answer




























          • If that other process (nginx, pid 780 in this case) is controlled by systemd (which isn't unlikely for Ubuntu), then this won't help because systemd will just restart it. But the basic idea is correct: find and stop the other process that ist listening on port 80. Or reconfigure them to use different ports.

            – PerlDuck
            May 29 at 8:56












          • Of course I tried to kill the process. The first time I kill nginx: master, I get nginx: worker. I also killed it. I also tried restarting the service.

            – Yangeok
            May 29 at 10:17












          • And the kill did not work?

            – Simon Sudler
            May 29 at 12:04


















          0


















          In the future, here's something that might come in useful. You can check the syntax of Nginx's configuration files by running:



          nginx -t -c /etc/nginx/nginx.conf



          The error output will give you a hint at what the problem is as well as the line number.



          or:



          debug with command:



          $ service nginx configtest



          Which outputs something like:



          Testing nginx configuration: nginx: [emerg] unknown directive "stub_status" in /etc/nginx/sites-enabled/nginx_status:11
          nginx: configuration file /etc/nginx/nginx.conf test failed






          share|improve this answer




























          • Yes, but in this particular case nginx cannot start (despite a correct config file) because the port 80 is already occupied by another process.

            – PerlDuck
            May 29 at 9:59











          • Thank you for your answer. I came to know something new.

            – Yangeok
            May 29 at 10:16












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147003%2funable-to-restart-nginx%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown


























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0


















          A application is currently listening on the on port 80. Most likely it is a other instance of nginx.



          Find application that is listening on the socket



          With the netstat command you can find the application which is currently listening on the socket. Also use grep to filter the output of netstat.



          $ netstat -lpn | grep 80
          tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 780/nginx: master p
          tcp6 0 0 :::80 :::* LISTEN 780/nginx: master p


          The last entry of the list 780/nginx tells you the PID of the process currently listening on the port 80.



          Find and kill the application



          With ps you can see the process structure of the process using the socket:



          $ ps f -g780
          PID TTY STAT TIME COMMAND
          780 ? Ss 0:00 nginx: master process nginx
          781 ? S 0:00 _ nginx: worker process
          782 ? S 0:00 _ nginx: worker process
          783 ? S 0:00 _ nginx: worker process
          784 ? S 0:00 _ nginx: worker process
          785 ? S 0:00 _ nginx: worker process
          786 ? S 0:00 _ nginx: worker process
          787 ? S 0:00 _ nginx: worker process
          788 ? S 0:00 _ nginx: worker process


          With the kill command you can now terminate the process which uses the socket:



          $ kill 780


          If that does not terminate the process with -9:



          $ kill -9 780


          Then try to restart your nginx service.






          share|improve this answer




























          • If that other process (nginx, pid 780 in this case) is controlled by systemd (which isn't unlikely for Ubuntu), then this won't help because systemd will just restart it. But the basic idea is correct: find and stop the other process that ist listening on port 80. Or reconfigure them to use different ports.

            – PerlDuck
            May 29 at 8:56












          • Of course I tried to kill the process. The first time I kill nginx: master, I get nginx: worker. I also killed it. I also tried restarting the service.

            – Yangeok
            May 29 at 10:17












          • And the kill did not work?

            – Simon Sudler
            May 29 at 12:04















          0


















          A application is currently listening on the on port 80. Most likely it is a other instance of nginx.



          Find application that is listening on the socket



          With the netstat command you can find the application which is currently listening on the socket. Also use grep to filter the output of netstat.



          $ netstat -lpn | grep 80
          tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 780/nginx: master p
          tcp6 0 0 :::80 :::* LISTEN 780/nginx: master p


          The last entry of the list 780/nginx tells you the PID of the process currently listening on the port 80.



          Find and kill the application



          With ps you can see the process structure of the process using the socket:



          $ ps f -g780
          PID TTY STAT TIME COMMAND
          780 ? Ss 0:00 nginx: master process nginx
          781 ? S 0:00 _ nginx: worker process
          782 ? S 0:00 _ nginx: worker process
          783 ? S 0:00 _ nginx: worker process
          784 ? S 0:00 _ nginx: worker process
          785 ? S 0:00 _ nginx: worker process
          786 ? S 0:00 _ nginx: worker process
          787 ? S 0:00 _ nginx: worker process
          788 ? S 0:00 _ nginx: worker process


          With the kill command you can now terminate the process which uses the socket:



          $ kill 780


          If that does not terminate the process with -9:



          $ kill -9 780


          Then try to restart your nginx service.






          share|improve this answer




























          • If that other process (nginx, pid 780 in this case) is controlled by systemd (which isn't unlikely for Ubuntu), then this won't help because systemd will just restart it. But the basic idea is correct: find and stop the other process that ist listening on port 80. Or reconfigure them to use different ports.

            – PerlDuck
            May 29 at 8:56












          • Of course I tried to kill the process. The first time I kill nginx: master, I get nginx: worker. I also killed it. I also tried restarting the service.

            – Yangeok
            May 29 at 10:17












          • And the kill did not work?

            – Simon Sudler
            May 29 at 12:04













          0














          0










          0









          A application is currently listening on the on port 80. Most likely it is a other instance of nginx.



          Find application that is listening on the socket



          With the netstat command you can find the application which is currently listening on the socket. Also use grep to filter the output of netstat.



          $ netstat -lpn | grep 80
          tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 780/nginx: master p
          tcp6 0 0 :::80 :::* LISTEN 780/nginx: master p


          The last entry of the list 780/nginx tells you the PID of the process currently listening on the port 80.



          Find and kill the application



          With ps you can see the process structure of the process using the socket:



          $ ps f -g780
          PID TTY STAT TIME COMMAND
          780 ? Ss 0:00 nginx: master process nginx
          781 ? S 0:00 _ nginx: worker process
          782 ? S 0:00 _ nginx: worker process
          783 ? S 0:00 _ nginx: worker process
          784 ? S 0:00 _ nginx: worker process
          785 ? S 0:00 _ nginx: worker process
          786 ? S 0:00 _ nginx: worker process
          787 ? S 0:00 _ nginx: worker process
          788 ? S 0:00 _ nginx: worker process


          With the kill command you can now terminate the process which uses the socket:



          $ kill 780


          If that does not terminate the process with -9:



          $ kill -9 780


          Then try to restart your nginx service.






          share|improve this answer
















          A application is currently listening on the on port 80. Most likely it is a other instance of nginx.



          Find application that is listening on the socket



          With the netstat command you can find the application which is currently listening on the socket. Also use grep to filter the output of netstat.



          $ netstat -lpn | grep 80
          tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 780/nginx: master p
          tcp6 0 0 :::80 :::* LISTEN 780/nginx: master p


          The last entry of the list 780/nginx tells you the PID of the process currently listening on the port 80.



          Find and kill the application



          With ps you can see the process structure of the process using the socket:



          $ ps f -g780
          PID TTY STAT TIME COMMAND
          780 ? Ss 0:00 nginx: master process nginx
          781 ? S 0:00 _ nginx: worker process
          782 ? S 0:00 _ nginx: worker process
          783 ? S 0:00 _ nginx: worker process
          784 ? S 0:00 _ nginx: worker process
          785 ? S 0:00 _ nginx: worker process
          786 ? S 0:00 _ nginx: worker process
          787 ? S 0:00 _ nginx: worker process
          788 ? S 0:00 _ nginx: worker process


          With the kill command you can now terminate the process which uses the socket:



          $ kill 780


          If that does not terminate the process with -9:



          $ kill -9 780


          Then try to restart your nginx service.







          share|improve this answer















          share|improve this answer




          share|improve this answer








          edited May 29 at 8:12

























          answered May 29 at 8:03









          Simon SudlerSimon Sudler

          2,16610 silver badges21 bronze badges




          2,16610 silver badges21 bronze badges















          • If that other process (nginx, pid 780 in this case) is controlled by systemd (which isn't unlikely for Ubuntu), then this won't help because systemd will just restart it. But the basic idea is correct: find and stop the other process that ist listening on port 80. Or reconfigure them to use different ports.

            – PerlDuck
            May 29 at 8:56












          • Of course I tried to kill the process. The first time I kill nginx: master, I get nginx: worker. I also killed it. I also tried restarting the service.

            – Yangeok
            May 29 at 10:17












          • And the kill did not work?

            – Simon Sudler
            May 29 at 12:04

















          • If that other process (nginx, pid 780 in this case) is controlled by systemd (which isn't unlikely for Ubuntu), then this won't help because systemd will just restart it. But the basic idea is correct: find and stop the other process that ist listening on port 80. Or reconfigure them to use different ports.

            – PerlDuck
            May 29 at 8:56












          • Of course I tried to kill the process. The first time I kill nginx: master, I get nginx: worker. I also killed it. I also tried restarting the service.

            – Yangeok
            May 29 at 10:17












          • And the kill did not work?

            – Simon Sudler
            May 29 at 12:04
















          If that other process (nginx, pid 780 in this case) is controlled by systemd (which isn't unlikely for Ubuntu), then this won't help because systemd will just restart it. But the basic idea is correct: find and stop the other process that ist listening on port 80. Or reconfigure them to use different ports.

          – PerlDuck
          May 29 at 8:56






          If that other process (nginx, pid 780 in this case) is controlled by systemd (which isn't unlikely for Ubuntu), then this won't help because systemd will just restart it. But the basic idea is correct: find and stop the other process that ist listening on port 80. Or reconfigure them to use different ports.

          – PerlDuck
          May 29 at 8:56














          Of course I tried to kill the process. The first time I kill nginx: master, I get nginx: worker. I also killed it. I also tried restarting the service.

          – Yangeok
          May 29 at 10:17






          Of course I tried to kill the process. The first time I kill nginx: master, I get nginx: worker. I also killed it. I also tried restarting the service.

          – Yangeok
          May 29 at 10:17














          And the kill did not work?

          – Simon Sudler
          May 29 at 12:04





          And the kill did not work?

          – Simon Sudler
          May 29 at 12:04













          0


















          In the future, here's something that might come in useful. You can check the syntax of Nginx's configuration files by running:



          nginx -t -c /etc/nginx/nginx.conf



          The error output will give you a hint at what the problem is as well as the line number.



          or:



          debug with command:



          $ service nginx configtest



          Which outputs something like:



          Testing nginx configuration: nginx: [emerg] unknown directive "stub_status" in /etc/nginx/sites-enabled/nginx_status:11
          nginx: configuration file /etc/nginx/nginx.conf test failed






          share|improve this answer




























          • Yes, but in this particular case nginx cannot start (despite a correct config file) because the port 80 is already occupied by another process.

            – PerlDuck
            May 29 at 9:59











          • Thank you for your answer. I came to know something new.

            – Yangeok
            May 29 at 10:16















          0


















          In the future, here's something that might come in useful. You can check the syntax of Nginx's configuration files by running:



          nginx -t -c /etc/nginx/nginx.conf



          The error output will give you a hint at what the problem is as well as the line number.



          or:



          debug with command:



          $ service nginx configtest



          Which outputs something like:



          Testing nginx configuration: nginx: [emerg] unknown directive "stub_status" in /etc/nginx/sites-enabled/nginx_status:11
          nginx: configuration file /etc/nginx/nginx.conf test failed






          share|improve this answer




























          • Yes, but in this particular case nginx cannot start (despite a correct config file) because the port 80 is already occupied by another process.

            – PerlDuck
            May 29 at 9:59











          • Thank you for your answer. I came to know something new.

            – Yangeok
            May 29 at 10:16













          0














          0










          0









          In the future, here's something that might come in useful. You can check the syntax of Nginx's configuration files by running:



          nginx -t -c /etc/nginx/nginx.conf



          The error output will give you a hint at what the problem is as well as the line number.



          or:



          debug with command:



          $ service nginx configtest



          Which outputs something like:



          Testing nginx configuration: nginx: [emerg] unknown directive "stub_status" in /etc/nginx/sites-enabled/nginx_status:11
          nginx: configuration file /etc/nginx/nginx.conf test failed






          share|improve this answer
















          In the future, here's something that might come in useful. You can check the syntax of Nginx's configuration files by running:



          nginx -t -c /etc/nginx/nginx.conf



          The error output will give you a hint at what the problem is as well as the line number.



          or:



          debug with command:



          $ service nginx configtest



          Which outputs something like:



          Testing nginx configuration: nginx: [emerg] unknown directive "stub_status" in /etc/nginx/sites-enabled/nginx_status:11
          nginx: configuration file /etc/nginx/nginx.conf test failed







          share|improve this answer















          share|improve this answer




          share|improve this answer








          edited May 29 at 16:41

























          answered May 29 at 8:57









          Mrz.RstMrz.Rst

          14 bronze badges




          14 bronze badges















          • Yes, but in this particular case nginx cannot start (despite a correct config file) because the port 80 is already occupied by another process.

            – PerlDuck
            May 29 at 9:59











          • Thank you for your answer. I came to know something new.

            – Yangeok
            May 29 at 10:16

















          • Yes, but in this particular case nginx cannot start (despite a correct config file) because the port 80 is already occupied by another process.

            – PerlDuck
            May 29 at 9:59











          • Thank you for your answer. I came to know something new.

            – Yangeok
            May 29 at 10:16
















          Yes, but in this particular case nginx cannot start (despite a correct config file) because the port 80 is already occupied by another process.

          – PerlDuck
          May 29 at 9:59





          Yes, but in this particular case nginx cannot start (despite a correct config file) because the port 80 is already occupied by another process.

          – PerlDuck
          May 29 at 9:59













          Thank you for your answer. I came to know something new.

          – Yangeok
          May 29 at 10:16





          Thank you for your answer. I came to know something new.

          – Yangeok
          May 29 at 10:16


















          draft saved

          draft discarded















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147003%2funable-to-restart-nginx%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown









          Popular posts from this blog

          Tamil (spriik) Luke uk diar | Nawigatjuun

          Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

          Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?