Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 for ServerName
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

lsof says:

michal@michaltest:/var/log/apache2$ sudo lsof -i :80
ubuntu-ge  2074 michal   11u  IPv4  23978      0t0  TCP michaltest.local:47578-> (CLOSE_WAIT)
firefox   25194 michal   71u  IPv4  42477      0t0  TCP michaltest.local:59793-> (ESTABLISHED)
firefox   25194 michal   76u  IPv4  41834      0t0  TCP michaltest.local:59698-> (ESTABLISHED)
gvfsd-htt 25320 michal   12u  IPv4  42568      0t0  TCP michaltest.local:56203-> (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


[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


NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    Listen 443

<IfModule mod_gnutls.c>
    Listen 443

Thanks for your help.

EDIT #1:

michal@michaltest:~$ sudo netstat -ano | grep '443'
tcp       54      0        CLOSE_WAIT  off (0.00/0/0)
share|improve this question

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* 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
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

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


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

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 ? – martin-mystere Nov 16 '12 at 8:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.