Unable to start Apache on Ubuntu 12.10: no listening sockets availableApache2 won't start - no listening sockets available - ubuntu 14.04Unable to access remotely (LAMP issue)Apache2 error no listening sockets avaliableGet Apache2 running with nginx as reverse proxysite inaccesible when i run a vhostxampp- unable to start apache on ubuntu 16

What are some ways to season that don't rely on garlic and onions?

How are characteristic classes morphisms of infinite loop spaces? (if they are)

What's the correct way to determine turn order in this situation?

What's the difference between motherboard and chassis?

Scorched receptacle

How to be productive while waiting for meetings to start

Mac no longer boots

Are there manual immigration checks for non EU citizens in airports when travelling inside the EU?

Is negative resistance possible?

Has a hard SciFi story addressed launching from Venus and its high-density atmosphere, especially after 1967?

How to calculate Limit of this sequence

Can 35 mm film which went through a washing machine still be developed?

What makes a character irredeemable?

Coffee Grounds and Gritty Butter Cream Icing

Are starfighters a realistic evolution of space naval warfare?

Advices to added homemade symbols

In 1700s, why was 'books that never read' grammatical?

Where does the image of a data connector as a sharp metal spike originate from?

How to define the line style in advance of plot function

Conveying the idea of "down the road" (i.e. in the future)

Would houseruling two or more instances of resistance to the same element as immunity be overly unbalanced?

I've been fired, was allowed to announce it as if I quit and given extra notice, how to handle the questions?

Does the DOJ's declining to investigate the Trump-Zelensky call ruin the basis for impeachment?

Using 4K Skyrim Textures when running 1920 x 1080 display resolution?



Unable to start Apache on Ubuntu 12.10: no listening sockets available


Apache2 won't start - no listening sockets available - ubuntu 14.04Unable to access remotely (LAMP issue)Apache2 error no listening sockets avaliableGet Apache2 running with nginx as reverse proxysite inaccesible when i run a vhostxampp- unable to start apache on ubuntu 16






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









9















I'm unable to start apache2 installed using apt-get. I'm getting the very same error on 2 separate Ubuntu 12.10 installations, one on my desktop PC, the other one running in VirtualBox:



michal@michaltest:~$ sudo service apache2 start
* Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
[fail]


lsof says:



michal@michaltest:/var/log/apache2$ sudo lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ubuntu-ge 2074 michal 11u IPv4 23978 0t0 TCP michaltest.local:47578->mulberry.canonical.com:http (CLOSE_WAIT)
firefox 25194 michal 71u IPv4 42477 0t0 TCP michaltest.local:59793->69.59.197.29:http (ESTABLISHED)
firefox 25194 michal 76u IPv4 41834 0t0 TCP michaltest.local:59698->69.59.197.29:http (ESTABLISHED)
gvfsd-htt 25320 michal 12u IPv4 42568 0t0 TCP michaltest.local:56203->lb260.amst.cotendo.net:http (CLOSE_WAIT)


netstat says:



michal@michaltest:/var/log/apache2$ sudo netstat -lnp | grep '80'
unix 2 [ ACC ] STREAM LISTENING 8030 876/acpid /var/run/acpid.socket


/var/log/apache2/error.log:



[Thu Nov 08 11:13:30 2012] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Thu Nov 08 11:17:32 2012] [notice] caught SIGTERM, shutting down


/etc/apache2/ports.conf:



NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
Listen 443
</IfModule>

<IfModule mod_gnutls.c>
Listen 443
</IfModule>


Thanks for your help.



EDIT #1:



michal@michaltest:~$ sudo netstat -ano | grep '443'
tcp 54 0 10.0.2.15:58504 91.189.92.70:443 CLOSE_WAIT off (0.00/0/0)









share|improve this question
































    9















    I'm unable to start apache2 installed using apt-get. I'm getting the very same error on 2 separate Ubuntu 12.10 installations, one on my desktop PC, the other one running in VirtualBox:



    michal@michaltest:~$ sudo service apache2 start
    * Starting web server apache2
    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
    no listening sockets available, shutting down
    Unable to open logs
    Action 'start' failed.
    The Apache error log may have more information.
    [fail]


    lsof says:



    michal@michaltest:/var/log/apache2$ sudo lsof -i :80
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    ubuntu-ge 2074 michal 11u IPv4 23978 0t0 TCP michaltest.local:47578->mulberry.canonical.com:http (CLOSE_WAIT)
    firefox 25194 michal 71u IPv4 42477 0t0 TCP michaltest.local:59793->69.59.197.29:http (ESTABLISHED)
    firefox 25194 michal 76u IPv4 41834 0t0 TCP michaltest.local:59698->69.59.197.29:http (ESTABLISHED)
    gvfsd-htt 25320 michal 12u IPv4 42568 0t0 TCP michaltest.local:56203->lb260.amst.cotendo.net:http (CLOSE_WAIT)


    netstat says:



    michal@michaltest:/var/log/apache2$ sudo netstat -lnp | grep '80'
    unix 2 [ ACC ] STREAM LISTENING 8030 876/acpid /var/run/acpid.socket


    /var/log/apache2/error.log:



    [Thu Nov 08 11:13:30 2012] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
    [Thu Nov 08 11:17:32 2012] [notice] caught SIGTERM, shutting down


    /etc/apache2/ports.conf:



    NameVirtualHost *:80
    Listen 80

    <IfModule mod_ssl.c>
    Listen 443
    </IfModule>

    <IfModule mod_gnutls.c>
    Listen 443
    </IfModule>


    Thanks for your help.



    EDIT #1:



    michal@michaltest:~$ sudo netstat -ano | grep '443'
    tcp 54 0 10.0.2.15:58504 91.189.92.70:443 CLOSE_WAIT off (0.00/0/0)









    share|improve this question




























      9












      9








      9


      4






      I'm unable to start apache2 installed using apt-get. I'm getting the very same error on 2 separate Ubuntu 12.10 installations, one on my desktop PC, the other one running in VirtualBox:



      michal@michaltest:~$ sudo service apache2 start
      * Starting web server apache2
      apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
      no listening sockets available, shutting down
      Unable to open logs
      Action 'start' failed.
      The Apache error log may have more information.
      [fail]


      lsof says:



      michal@michaltest:/var/log/apache2$ sudo lsof -i :80
      COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
      ubuntu-ge 2074 michal 11u IPv4 23978 0t0 TCP michaltest.local:47578->mulberry.canonical.com:http (CLOSE_WAIT)
      firefox 25194 michal 71u IPv4 42477 0t0 TCP michaltest.local:59793->69.59.197.29:http (ESTABLISHED)
      firefox 25194 michal 76u IPv4 41834 0t0 TCP michaltest.local:59698->69.59.197.29:http (ESTABLISHED)
      gvfsd-htt 25320 michal 12u IPv4 42568 0t0 TCP michaltest.local:56203->lb260.amst.cotendo.net:http (CLOSE_WAIT)


      netstat says:



      michal@michaltest:/var/log/apache2$ sudo netstat -lnp | grep '80'
      unix 2 [ ACC ] STREAM LISTENING 8030 876/acpid /var/run/acpid.socket


      /var/log/apache2/error.log:



      [Thu Nov 08 11:13:30 2012] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
      [Thu Nov 08 11:17:32 2012] [notice] caught SIGTERM, shutting down


      /etc/apache2/ports.conf:



      NameVirtualHost *:80
      Listen 80

      <IfModule mod_ssl.c>
      Listen 443
      </IfModule>

      <IfModule mod_gnutls.c>
      Listen 443
      </IfModule>


      Thanks for your help.



      EDIT #1:



      michal@michaltest:~$ sudo netstat -ano | grep '443'
      tcp 54 0 10.0.2.15:58504 91.189.92.70:443 CLOSE_WAIT off (0.00/0/0)









      share|improve this question
















      I'm unable to start apache2 installed using apt-get. I'm getting the very same error on 2 separate Ubuntu 12.10 installations, one on my desktop PC, the other one running in VirtualBox:



      michal@michaltest:~$ sudo service apache2 start
      * Starting web server apache2
      apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
      no listening sockets available, shutting down
      Unable to open logs
      Action 'start' failed.
      The Apache error log may have more information.
      [fail]


      lsof says:



      michal@michaltest:/var/log/apache2$ sudo lsof -i :80
      COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
      ubuntu-ge 2074 michal 11u IPv4 23978 0t0 TCP michaltest.local:47578->mulberry.canonical.com:http (CLOSE_WAIT)
      firefox 25194 michal 71u IPv4 42477 0t0 TCP michaltest.local:59793->69.59.197.29:http (ESTABLISHED)
      firefox 25194 michal 76u IPv4 41834 0t0 TCP michaltest.local:59698->69.59.197.29:http (ESTABLISHED)
      gvfsd-htt 25320 michal 12u IPv4 42568 0t0 TCP michaltest.local:56203->lb260.amst.cotendo.net:http (CLOSE_WAIT)


      netstat says:



      michal@michaltest:/var/log/apache2$ sudo netstat -lnp | grep '80'
      unix 2 [ ACC ] STREAM LISTENING 8030 876/acpid /var/run/acpid.socket


      /var/log/apache2/error.log:



      [Thu Nov 08 11:13:30 2012] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
      [Thu Nov 08 11:17:32 2012] [notice] caught SIGTERM, shutting down


      /etc/apache2/ports.conf:



      NameVirtualHost *:80
      Listen 80

      <IfModule mod_ssl.c>
      Listen 443
      </IfModule>

      <IfModule mod_gnutls.c>
      Listen 443
      </IfModule>


      Thanks for your help.



      EDIT #1:



      michal@michaltest:~$ sudo netstat -ano | grep '443'
      tcp 54 0 10.0.2.15:58504 91.189.92.70:443 CLOSE_WAIT off (0.00/0/0)






      12.10 apache2 sockets






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '12 at 10:51







      michalstanko

















      asked Nov 15 '12 at 9:34









      michalstankomichalstanko

      1461 gold badge1 silver badge5 bronze badges




      1461 gold badge1 silver badge5 bronze badges























          5 Answers
          5






          active

          oldest

          votes


















          8
















          you just need to remove nginx (3 packages) then that's it.....



          Your primary issue is no listening sockets available.You are facing this issue because another application/service acquired port 80 on your Ubuntu Server.



          Now you need to Kill the process which acquired port 80. You can find that easily with following command :-




          sudo netstat -ltnp | grep ':80'




          This will return something like :-




          tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 1588/aolserver4-nsd




          for above case Process number 1588 acquired port 80 , you need to kill that process 1588.




          sudo kill -9 1588




          Now you can start your apache server by following command




          sudo /etc/init.d/apache2 start







          share|improve this answer






















          • 3





            Thanks! This stumped me a bit, because it says that "The Apache error log may have more information", yet there's nothing in there, also "Unable to open logs", but there are no information which log file (apache's? the vhosts'?). Turns out that nodejs is still using port 80..

            – andyk
            Feb 5 '14 at 5:11











          • I get the same error, but netstat lists nothing using port 80...

            – Cerin
            Aug 10 '17 at 19:57











          • @Cerin you should try sudo before netstat.

            – Vikas Dwivedi
            Aug 16 '17 at 9:20


















          2
















          To resolve "apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName" error, kindly specify following in your apache2.conf file



          ServerName HOSTNAME_OF_THE_SERVER


          Save conf file and restart apache server.



          Kindly post the output of sudo netstat -ano | grep '443'



          Also ensure that if you are configuring apache to listen on 443 / ssl port you should have configured ssl certificate on apache webserver.






          share|improve this answer

























          • I posted the output of sudo netstat -ano | grep '443'. The ServerName thing is not an issue. Thank you very much.

            – michalstanko
            Nov 15 '12 at 10:53


















          1
















          Did you see:



          Unable to open logs


          I think you could check permissions on /var/log/apache2 !






          share|improve this answer

























          • I'm a bit of a novice, however I've made the /var/log/apache2 directory recursively world-writeable, then tried running sudo service apache2 start again and the output still had Unable to open logs in there. Any suggestions? Thanks.

            – michalstanko
            Nov 15 '12 at 12:21











          • Hmm. So could it be something like that ? cpanelblog.in/apache-error-unable-to-open-logs

            – martin-mystere
            Nov 16 '12 at 8:50


















          1
















          It looks like there might be nginx service running behind. So stop the nginx "service nginx stop" and now try to start the apache2 service, it should come without any issues. ( stop if any other app services are running )



          I had the same issue today and it got resolved.



          root@ip-172-31-16-xxx:~# **service nginx stop**
          root@ip-172-31-16-xxx:~# **service nginx status**
          ● nginx.service - A high performance web server and a reverse proxy server
          Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
          Active: inactive (dead) since Tue 2017-12-26 08:48:21 UTC; 1min 12s ago
          Process: 5897 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
          Process: 1220 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
          Process: 1158 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
          Main PID: 1229 (code=exited, status=0/SUCCESS)

          Dec 26 06:56:32 ip-172-31-16-xxxsystemd[1]: Starting A high performance web server and a reverse proxy server...
          Dec 26 06:56:32 ip-172-31-16-138 systemd[1]: Started A high performance web server and a reverse proxy server.
          Dec 26 08:48:21 ip-172-31-16-138 systemd[1]: Stopping A high performance web server and a reverse proxy server...
          Dec 26 08:48:21 ip-172-31-16-138 systemd[1]: Stopped A high performance web server and a reverse proxy server.

          root@ip-172-31-16-xxx:~# **service apache2 start**
          root@ip-172-31-16-xxx:~# **service apache2 status**
          ● apache2.service - LSB: Apache2 web server
          Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
          Drop-In: /lib/systemd/system/apache2.service.d
          └─apache2-systemd.conf
          **Active: active (running) since Tue 2017-12-26 08:49:51 UTC; 14s ago**
          Docs: man:systemd-sysv-generator(8)
          Process: 5845 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
          Process: 5937 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
          Tasks: 55
          Memory: 6.5M
          CPU: 46ms
          CGroup: /system.slice/apache2.service
          ├─5954 /usr/sbin/apache2 -k start
          ├─5957 /usr/sbin/apache2 -k start
          └─5958 /usr/sbin/apache2 -k start

          Dec 26 08:49:50 ip-172-31-16-138 systemd[1]: Starting LSB: Apache2 web server...
          Dec 26 08:49:50 ip-172-31-16-138 apache2[5937]: * Starting Apache httpd web server apache2
          Dec 26 08:49:51 ip-172-31-16-138 apache2[5937]: *
          Dec 26 08:49:51 ip-172-31-16-138 systemd[1]: Started LSB: Apache2 web server.
          root@ip-172-31-16-138:~#





          share|improve this answer


































            0
















            Sounds like the problem is that another process has port 443 open. You'll need to kill that process first.



            linux - How do I remove a CLOSE_WAIT socket connection - Stack Overflow says:




            CLOSE_WAIT means your program is still running, and hasn't closed the socket (and the kernel is waiting for it to do so). Add -p to netstat to get the pid, and then kill it more forcefully (with SIGKILL if needed). That should get rid of your CLOSE_WAIT sockets. You can also use ps to find the pid.







            share|improve this answer




























              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%2f217518%2funable-to-start-apache-on-ubuntu-12-10-no-listening-sockets-available%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              5 Answers
              5






              active

              oldest

              votes








              5 Answers
              5






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              8
















              you just need to remove nginx (3 packages) then that's it.....



              Your primary issue is no listening sockets available.You are facing this issue because another application/service acquired port 80 on your Ubuntu Server.



              Now you need to Kill the process which acquired port 80. You can find that easily with following command :-




              sudo netstat -ltnp | grep ':80'




              This will return something like :-




              tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 1588/aolserver4-nsd




              for above case Process number 1588 acquired port 80 , you need to kill that process 1588.




              sudo kill -9 1588




              Now you can start your apache server by following command




              sudo /etc/init.d/apache2 start







              share|improve this answer






















              • 3





                Thanks! This stumped me a bit, because it says that "The Apache error log may have more information", yet there's nothing in there, also "Unable to open logs", but there are no information which log file (apache's? the vhosts'?). Turns out that nodejs is still using port 80..

                – andyk
                Feb 5 '14 at 5:11











              • I get the same error, but netstat lists nothing using port 80...

                – Cerin
                Aug 10 '17 at 19:57











              • @Cerin you should try sudo before netstat.

                – Vikas Dwivedi
                Aug 16 '17 at 9:20















              8
















              you just need to remove nginx (3 packages) then that's it.....



              Your primary issue is no listening sockets available.You are facing this issue because another application/service acquired port 80 on your Ubuntu Server.



              Now you need to Kill the process which acquired port 80. You can find that easily with following command :-




              sudo netstat -ltnp | grep ':80'




              This will return something like :-




              tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 1588/aolserver4-nsd




              for above case Process number 1588 acquired port 80 , you need to kill that process 1588.




              sudo kill -9 1588




              Now you can start your apache server by following command




              sudo /etc/init.d/apache2 start







              share|improve this answer






















              • 3





                Thanks! This stumped me a bit, because it says that "The Apache error log may have more information", yet there's nothing in there, also "Unable to open logs", but there are no information which log file (apache's? the vhosts'?). Turns out that nodejs is still using port 80..

                – andyk
                Feb 5 '14 at 5:11











              • I get the same error, but netstat lists nothing using port 80...

                – Cerin
                Aug 10 '17 at 19:57











              • @Cerin you should try sudo before netstat.

                – Vikas Dwivedi
                Aug 16 '17 at 9:20













              8














              8










              8









              you just need to remove nginx (3 packages) then that's it.....



              Your primary issue is no listening sockets available.You are facing this issue because another application/service acquired port 80 on your Ubuntu Server.



              Now you need to Kill the process which acquired port 80. You can find that easily with following command :-




              sudo netstat -ltnp | grep ':80'




              This will return something like :-




              tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 1588/aolserver4-nsd




              for above case Process number 1588 acquired port 80 , you need to kill that process 1588.




              sudo kill -9 1588




              Now you can start your apache server by following command




              sudo /etc/init.d/apache2 start







              share|improve this answer















              you just need to remove nginx (3 packages) then that's it.....



              Your primary issue is no listening sockets available.You are facing this issue because another application/service acquired port 80 on your Ubuntu Server.



              Now you need to Kill the process which acquired port 80. You can find that easily with following command :-




              sudo netstat -ltnp | grep ':80'




              This will return something like :-




              tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 1588/aolserver4-nsd




              for above case Process number 1588 acquired port 80 , you need to kill that process 1588.




              sudo kill -9 1588




              Now you can start your apache server by following command




              sudo /etc/init.d/apache2 start








              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Apr 16 at 19:14









              Community

              1




              1










              answered Dec 17 '13 at 15:55









              Vikas DwivediVikas Dwivedi

              1891 silver badge5 bronze badges




              1891 silver badge5 bronze badges










              • 3





                Thanks! This stumped me a bit, because it says that "The Apache error log may have more information", yet there's nothing in there, also "Unable to open logs", but there are no information which log file (apache's? the vhosts'?). Turns out that nodejs is still using port 80..

                – andyk
                Feb 5 '14 at 5:11











              • I get the same error, but netstat lists nothing using port 80...

                – Cerin
                Aug 10 '17 at 19:57











              • @Cerin you should try sudo before netstat.

                – Vikas Dwivedi
                Aug 16 '17 at 9:20












              • 3





                Thanks! This stumped me a bit, because it says that "The Apache error log may have more information", yet there's nothing in there, also "Unable to open logs", but there are no information which log file (apache's? the vhosts'?). Turns out that nodejs is still using port 80..

                – andyk
                Feb 5 '14 at 5:11











              • I get the same error, but netstat lists nothing using port 80...

                – Cerin
                Aug 10 '17 at 19:57











              • @Cerin you should try sudo before netstat.

                – Vikas Dwivedi
                Aug 16 '17 at 9:20







              3




              3





              Thanks! This stumped me a bit, because it says that "The Apache error log may have more information", yet there's nothing in there, also "Unable to open logs", but there are no information which log file (apache's? the vhosts'?). Turns out that nodejs is still using port 80..

              – andyk
              Feb 5 '14 at 5:11





              Thanks! This stumped me a bit, because it says that "The Apache error log may have more information", yet there's nothing in there, also "Unable to open logs", but there are no information which log file (apache's? the vhosts'?). Turns out that nodejs is still using port 80..

              – andyk
              Feb 5 '14 at 5:11













              I get the same error, but netstat lists nothing using port 80...

              – Cerin
              Aug 10 '17 at 19:57





              I get the same error, but netstat lists nothing using port 80...

              – Cerin
              Aug 10 '17 at 19:57













              @Cerin you should try sudo before netstat.

              – Vikas Dwivedi
              Aug 16 '17 at 9:20





              @Cerin you should try sudo before netstat.

              – Vikas Dwivedi
              Aug 16 '17 at 9:20













              2
















              To resolve "apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName" error, kindly specify following in your apache2.conf file



              ServerName HOSTNAME_OF_THE_SERVER


              Save conf file and restart apache server.



              Kindly post the output of sudo netstat -ano | grep '443'



              Also ensure that if you are configuring apache to listen on 443 / ssl port you should have configured ssl certificate on apache webserver.






              share|improve this answer

























              • I posted the output of sudo netstat -ano | grep '443'. The ServerName thing is not an issue. Thank you very much.

                – michalstanko
                Nov 15 '12 at 10:53















              2
















              To resolve "apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName" error, kindly specify following in your apache2.conf file



              ServerName HOSTNAME_OF_THE_SERVER


              Save conf file and restart apache server.



              Kindly post the output of sudo netstat -ano | grep '443'



              Also ensure that if you are configuring apache to listen on 443 / ssl port you should have configured ssl certificate on apache webserver.






              share|improve this answer

























              • I posted the output of sudo netstat -ano | grep '443'. The ServerName thing is not an issue. Thank you very much.

                – michalstanko
                Nov 15 '12 at 10:53













              2














              2










              2









              To resolve "apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName" error, kindly specify following in your apache2.conf file



              ServerName HOSTNAME_OF_THE_SERVER


              Save conf file and restart apache server.



              Kindly post the output of sudo netstat -ano | grep '443'



              Also ensure that if you are configuring apache to listen on 443 / ssl port you should have configured ssl certificate on apache webserver.






              share|improve this answer













              To resolve "apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName" error, kindly specify following in your apache2.conf file



              ServerName HOSTNAME_OF_THE_SERVER


              Save conf file and restart apache server.



              Kindly post the output of sudo netstat -ano | grep '443'



              Also ensure that if you are configuring apache to listen on 443 / ssl port you should have configured ssl certificate on apache webserver.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Nov 15 '12 at 10:35









              VidyadharVidyadhar

              1,36210 silver badges11 bronze badges




              1,36210 silver badges11 bronze badges















              • I posted the output of sudo netstat -ano | grep '443'. The ServerName thing is not an issue. Thank you very much.

                – michalstanko
                Nov 15 '12 at 10:53

















              • I posted the output of sudo netstat -ano | grep '443'. The ServerName thing is not an issue. Thank you very much.

                – michalstanko
                Nov 15 '12 at 10:53
















              I posted the output of sudo netstat -ano | grep '443'. The ServerName thing is not an issue. Thank you very much.

              – michalstanko
              Nov 15 '12 at 10:53





              I posted the output of sudo netstat -ano | grep '443'. The ServerName thing is not an issue. Thank you very much.

              – michalstanko
              Nov 15 '12 at 10:53











              1
















              Did you see:



              Unable to open logs


              I think you could check permissions on /var/log/apache2 !






              share|improve this answer

























              • I'm a bit of a novice, however I've made the /var/log/apache2 directory recursively world-writeable, then tried running sudo service apache2 start again and the output still had Unable to open logs in there. Any suggestions? Thanks.

                – michalstanko
                Nov 15 '12 at 12:21











              • Hmm. So could it be something like that ? cpanelblog.in/apache-error-unable-to-open-logs

                – martin-mystere
                Nov 16 '12 at 8:50















              1
















              Did you see:



              Unable to open logs


              I think you could check permissions on /var/log/apache2 !






              share|improve this answer

























              • I'm a bit of a novice, however I've made the /var/log/apache2 directory recursively world-writeable, then tried running sudo service apache2 start again and the output still had Unable to open logs in there. Any suggestions? Thanks.

                – michalstanko
                Nov 15 '12 at 12:21











              • Hmm. So could it be something like that ? cpanelblog.in/apache-error-unable-to-open-logs

                – martin-mystere
                Nov 16 '12 at 8:50













              1














              1










              1









              Did you see:



              Unable to open logs


              I think you could check permissions on /var/log/apache2 !






              share|improve this answer













              Did you see:



              Unable to open logs


              I think you could check permissions on /var/log/apache2 !







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Nov 15 '12 at 11:23









              martin-mysteremartin-mystere

              4133 silver badges14 bronze badges




              4133 silver badges14 bronze badges















              • I'm a bit of a novice, however I've made the /var/log/apache2 directory recursively world-writeable, then tried running sudo service apache2 start again and the output still had Unable to open logs in there. Any suggestions? Thanks.

                – michalstanko
                Nov 15 '12 at 12:21











              • Hmm. So could it be something like that ? cpanelblog.in/apache-error-unable-to-open-logs

                – martin-mystere
                Nov 16 '12 at 8:50

















              • I'm a bit of a novice, however I've made the /var/log/apache2 directory recursively world-writeable, then tried running sudo service apache2 start again and the output still had Unable to open logs in there. Any suggestions? Thanks.

                – michalstanko
                Nov 15 '12 at 12:21











              • Hmm. So could it be something like that ? cpanelblog.in/apache-error-unable-to-open-logs

                – martin-mystere
                Nov 16 '12 at 8:50
















              I'm a bit of a novice, however I've made the /var/log/apache2 directory recursively world-writeable, then tried running sudo service apache2 start again and the output still had Unable to open logs in there. Any suggestions? Thanks.

              – michalstanko
              Nov 15 '12 at 12:21





              I'm a bit of a novice, however I've made the /var/log/apache2 directory recursively world-writeable, then tried running sudo service apache2 start again and the output still had Unable to open logs in there. Any suggestions? Thanks.

              – michalstanko
              Nov 15 '12 at 12:21













              Hmm. So could it be something like that ? cpanelblog.in/apache-error-unable-to-open-logs

              – martin-mystere
              Nov 16 '12 at 8:50





              Hmm. So could it be something like that ? cpanelblog.in/apache-error-unable-to-open-logs

              – martin-mystere
              Nov 16 '12 at 8:50











              1
















              It looks like there might be nginx service running behind. So stop the nginx "service nginx stop" and now try to start the apache2 service, it should come without any issues. ( stop if any other app services are running )



              I had the same issue today and it got resolved.



              root@ip-172-31-16-xxx:~# **service nginx stop**
              root@ip-172-31-16-xxx:~# **service nginx status**
              ● nginx.service - A high performance web server and a reverse proxy server
              Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
              Active: inactive (dead) since Tue 2017-12-26 08:48:21 UTC; 1min 12s ago
              Process: 5897 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
              Process: 1220 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
              Process: 1158 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
              Main PID: 1229 (code=exited, status=0/SUCCESS)

              Dec 26 06:56:32 ip-172-31-16-xxxsystemd[1]: Starting A high performance web server and a reverse proxy server...
              Dec 26 06:56:32 ip-172-31-16-138 systemd[1]: Started A high performance web server and a reverse proxy server.
              Dec 26 08:48:21 ip-172-31-16-138 systemd[1]: Stopping A high performance web server and a reverse proxy server...
              Dec 26 08:48:21 ip-172-31-16-138 systemd[1]: Stopped A high performance web server and a reverse proxy server.

              root@ip-172-31-16-xxx:~# **service apache2 start**
              root@ip-172-31-16-xxx:~# **service apache2 status**
              ● apache2.service - LSB: Apache2 web server
              Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
              Drop-In: /lib/systemd/system/apache2.service.d
              └─apache2-systemd.conf
              **Active: active (running) since Tue 2017-12-26 08:49:51 UTC; 14s ago**
              Docs: man:systemd-sysv-generator(8)
              Process: 5845 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
              Process: 5937 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
              Tasks: 55
              Memory: 6.5M
              CPU: 46ms
              CGroup: /system.slice/apache2.service
              ├─5954 /usr/sbin/apache2 -k start
              ├─5957 /usr/sbin/apache2 -k start
              └─5958 /usr/sbin/apache2 -k start

              Dec 26 08:49:50 ip-172-31-16-138 systemd[1]: Starting LSB: Apache2 web server...
              Dec 26 08:49:50 ip-172-31-16-138 apache2[5937]: * Starting Apache httpd web server apache2
              Dec 26 08:49:51 ip-172-31-16-138 apache2[5937]: *
              Dec 26 08:49:51 ip-172-31-16-138 systemd[1]: Started LSB: Apache2 web server.
              root@ip-172-31-16-138:~#





              share|improve this answer































                1
















                It looks like there might be nginx service running behind. So stop the nginx "service nginx stop" and now try to start the apache2 service, it should come without any issues. ( stop if any other app services are running )



                I had the same issue today and it got resolved.



                root@ip-172-31-16-xxx:~# **service nginx stop**
                root@ip-172-31-16-xxx:~# **service nginx status**
                ● nginx.service - A high performance web server and a reverse proxy server
                Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
                Active: inactive (dead) since Tue 2017-12-26 08:48:21 UTC; 1min 12s ago
                Process: 5897 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
                Process: 1220 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
                Process: 1158 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
                Main PID: 1229 (code=exited, status=0/SUCCESS)

                Dec 26 06:56:32 ip-172-31-16-xxxsystemd[1]: Starting A high performance web server and a reverse proxy server...
                Dec 26 06:56:32 ip-172-31-16-138 systemd[1]: Started A high performance web server and a reverse proxy server.
                Dec 26 08:48:21 ip-172-31-16-138 systemd[1]: Stopping A high performance web server and a reverse proxy server...
                Dec 26 08:48:21 ip-172-31-16-138 systemd[1]: Stopped A high performance web server and a reverse proxy server.

                root@ip-172-31-16-xxx:~# **service apache2 start**
                root@ip-172-31-16-xxx:~# **service apache2 status**
                ● apache2.service - LSB: Apache2 web server
                Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
                Drop-In: /lib/systemd/system/apache2.service.d
                └─apache2-systemd.conf
                **Active: active (running) since Tue 2017-12-26 08:49:51 UTC; 14s ago**
                Docs: man:systemd-sysv-generator(8)
                Process: 5845 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
                Process: 5937 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
                Tasks: 55
                Memory: 6.5M
                CPU: 46ms
                CGroup: /system.slice/apache2.service
                ├─5954 /usr/sbin/apache2 -k start
                ├─5957 /usr/sbin/apache2 -k start
                └─5958 /usr/sbin/apache2 -k start

                Dec 26 08:49:50 ip-172-31-16-138 systemd[1]: Starting LSB: Apache2 web server...
                Dec 26 08:49:50 ip-172-31-16-138 apache2[5937]: * Starting Apache httpd web server apache2
                Dec 26 08:49:51 ip-172-31-16-138 apache2[5937]: *
                Dec 26 08:49:51 ip-172-31-16-138 systemd[1]: Started LSB: Apache2 web server.
                root@ip-172-31-16-138:~#





                share|improve this answer





























                  1














                  1










                  1









                  It looks like there might be nginx service running behind. So stop the nginx "service nginx stop" and now try to start the apache2 service, it should come without any issues. ( stop if any other app services are running )



                  I had the same issue today and it got resolved.



                  root@ip-172-31-16-xxx:~# **service nginx stop**
                  root@ip-172-31-16-xxx:~# **service nginx status**
                  ● nginx.service - A high performance web server and a reverse proxy server
                  Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
                  Active: inactive (dead) since Tue 2017-12-26 08:48:21 UTC; 1min 12s ago
                  Process: 5897 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
                  Process: 1220 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
                  Process: 1158 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
                  Main PID: 1229 (code=exited, status=0/SUCCESS)

                  Dec 26 06:56:32 ip-172-31-16-xxxsystemd[1]: Starting A high performance web server and a reverse proxy server...
                  Dec 26 06:56:32 ip-172-31-16-138 systemd[1]: Started A high performance web server and a reverse proxy server.
                  Dec 26 08:48:21 ip-172-31-16-138 systemd[1]: Stopping A high performance web server and a reverse proxy server...
                  Dec 26 08:48:21 ip-172-31-16-138 systemd[1]: Stopped A high performance web server and a reverse proxy server.

                  root@ip-172-31-16-xxx:~# **service apache2 start**
                  root@ip-172-31-16-xxx:~# **service apache2 status**
                  ● apache2.service - LSB: Apache2 web server
                  Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
                  Drop-In: /lib/systemd/system/apache2.service.d
                  └─apache2-systemd.conf
                  **Active: active (running) since Tue 2017-12-26 08:49:51 UTC; 14s ago**
                  Docs: man:systemd-sysv-generator(8)
                  Process: 5845 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
                  Process: 5937 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
                  Tasks: 55
                  Memory: 6.5M
                  CPU: 46ms
                  CGroup: /system.slice/apache2.service
                  ├─5954 /usr/sbin/apache2 -k start
                  ├─5957 /usr/sbin/apache2 -k start
                  └─5958 /usr/sbin/apache2 -k start

                  Dec 26 08:49:50 ip-172-31-16-138 systemd[1]: Starting LSB: Apache2 web server...
                  Dec 26 08:49:50 ip-172-31-16-138 apache2[5937]: * Starting Apache httpd web server apache2
                  Dec 26 08:49:51 ip-172-31-16-138 apache2[5937]: *
                  Dec 26 08:49:51 ip-172-31-16-138 systemd[1]: Started LSB: Apache2 web server.
                  root@ip-172-31-16-138:~#





                  share|improve this answer















                  It looks like there might be nginx service running behind. So stop the nginx "service nginx stop" and now try to start the apache2 service, it should come without any issues. ( stop if any other app services are running )



                  I had the same issue today and it got resolved.



                  root@ip-172-31-16-xxx:~# **service nginx stop**
                  root@ip-172-31-16-xxx:~# **service nginx status**
                  ● nginx.service - A high performance web server and a reverse proxy server
                  Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
                  Active: inactive (dead) since Tue 2017-12-26 08:48:21 UTC; 1min 12s ago
                  Process: 5897 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
                  Process: 1220 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
                  Process: 1158 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
                  Main PID: 1229 (code=exited, status=0/SUCCESS)

                  Dec 26 06:56:32 ip-172-31-16-xxxsystemd[1]: Starting A high performance web server and a reverse proxy server...
                  Dec 26 06:56:32 ip-172-31-16-138 systemd[1]: Started A high performance web server and a reverse proxy server.
                  Dec 26 08:48:21 ip-172-31-16-138 systemd[1]: Stopping A high performance web server and a reverse proxy server...
                  Dec 26 08:48:21 ip-172-31-16-138 systemd[1]: Stopped A high performance web server and a reverse proxy server.

                  root@ip-172-31-16-xxx:~# **service apache2 start**
                  root@ip-172-31-16-xxx:~# **service apache2 status**
                  ● apache2.service - LSB: Apache2 web server
                  Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
                  Drop-In: /lib/systemd/system/apache2.service.d
                  └─apache2-systemd.conf
                  **Active: active (running) since Tue 2017-12-26 08:49:51 UTC; 14s ago**
                  Docs: man:systemd-sysv-generator(8)
                  Process: 5845 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
                  Process: 5937 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
                  Tasks: 55
                  Memory: 6.5M
                  CPU: 46ms
                  CGroup: /system.slice/apache2.service
                  ├─5954 /usr/sbin/apache2 -k start
                  ├─5957 /usr/sbin/apache2 -k start
                  └─5958 /usr/sbin/apache2 -k start

                  Dec 26 08:49:50 ip-172-31-16-138 systemd[1]: Starting LSB: Apache2 web server...
                  Dec 26 08:49:50 ip-172-31-16-138 apache2[5937]: * Starting Apache httpd web server apache2
                  Dec 26 08:49:51 ip-172-31-16-138 apache2[5937]: *
                  Dec 26 08:49:51 ip-172-31-16-138 systemd[1]: Started LSB: Apache2 web server.
                  root@ip-172-31-16-138:~#






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Dec 26 '17 at 9:31









                  karel

                  68.4k15 gold badges154 silver badges173 bronze badges




                  68.4k15 gold badges154 silver badges173 bronze badges










                  answered Dec 26 '17 at 8:54









                  Nagaraj JalawadiNagaraj Jalawadi

                  111 bronze badge




                  111 bronze badge
























                      0
















                      Sounds like the problem is that another process has port 443 open. You'll need to kill that process first.



                      linux - How do I remove a CLOSE_WAIT socket connection - Stack Overflow says:




                      CLOSE_WAIT means your program is still running, and hasn't closed the socket (and the kernel is waiting for it to do so). Add -p to netstat to get the pid, and then kill it more forcefully (with SIGKILL if needed). That should get rid of your CLOSE_WAIT sockets. You can also use ps to find the pid.







                      share|improve this answer































                        0
















                        Sounds like the problem is that another process has port 443 open. You'll need to kill that process first.



                        linux - How do I remove a CLOSE_WAIT socket connection - Stack Overflow says:




                        CLOSE_WAIT means your program is still running, and hasn't closed the socket (and the kernel is waiting for it to do so). Add -p to netstat to get the pid, and then kill it more forcefully (with SIGKILL if needed). That should get rid of your CLOSE_WAIT sockets. You can also use ps to find the pid.







                        share|improve this answer





























                          0














                          0










                          0









                          Sounds like the problem is that another process has port 443 open. You'll need to kill that process first.



                          linux - How do I remove a CLOSE_WAIT socket connection - Stack Overflow says:




                          CLOSE_WAIT means your program is still running, and hasn't closed the socket (and the kernel is waiting for it to do so). Add -p to netstat to get the pid, and then kill it more forcefully (with SIGKILL if needed). That should get rid of your CLOSE_WAIT sockets. You can also use ps to find the pid.







                          share|improve this answer















                          Sounds like the problem is that another process has port 443 open. You'll need to kill that process first.



                          linux - How do I remove a CLOSE_WAIT socket connection - Stack Overflow says:




                          CLOSE_WAIT means your program is still running, and hasn't closed the socket (and the kernel is waiting for it to do so). Add -p to netstat to get the pid, and then kill it more forcefully (with SIGKILL if needed). That should get rid of your CLOSE_WAIT sockets. You can also use ps to find the pid.








                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited May 23 '17 at 12:39









                          Community

                          1




                          1










                          answered Aug 23 '16 at 12:10









                          Peter V. MørchPeter V. Mørch

                          2,1481 gold badge22 silver badges26 bronze badges




                          2,1481 gold badge22 silver badges26 bronze badges































                              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%2f217518%2funable-to-start-apache-on-ubuntu-12-10-no-listening-sockets-available%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?