0

I just try to install apache2 on my 14.04 Ubuntu server but I get an error:

 * Starting web server apache2                                                                       (98)Address already in use: AH00073: make_sock: unable to listen for connections on address [::]:80
(98)Address already in use: AH00073: make_sock: unable to listen for connections on address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
 * 
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
invoke-rc.d: initscript apache2, action "start" failed.
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...

I try to access the log file at /var/log/apache2/access.log but the file's empty.

Please help me to solve this error. Thanks.

UPDATE: I get this to netstat -antp | grep 80

(No info could be read for "-p": geteuid()=1001 but you should be root.)
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:8082            0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:8001            0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:5432          127.0.0.1:42080         ESTABLISHED -               
tcp        0      0 127.0.0.1:42080         127.0.0.1:5432          ESTABLISHED -               
tcp        0      0 127.0.0.1:41880         127.0.0.1:5432          ESTABLISHED -               
tcp        0      0 127.0.0.1:53380         127.0.0.1:11211         ESTABLISHED -               
tcp        0      0 127.0.0.1:38980         127.0.0.1:11211         TIME_WAIT   -               
tcp        0      0 127.0.0.1:11211         127.0.0.1:53380         ESTABLISHED -               
tcp        0      0 127.0.0.1:5432          127.0.0.1:41809         ESTABLISHED -               
tcp        0      0 127.0.0.1:5432          127.0.0.1:41880         ESTABLISHED -               
tcp        0      0 127.0.0.1:41809         127.0.0.1:5432          ESTABLISHED -               
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      -   
Hhaevs
  • 1
  • Youre using skype by any chance ? Asking this because skype is known to take up port 80 and preventing apache2 this way from starting. – Videonauth May 15 '16 at 15:43
  • use netstat -antp | grep 80 to see what is using port 80. This might be a duplicate of http://askubuntu.com/questions/277162/apache-fails-to-start-address-already-in-use-but-not-really – Ron May 15 '16 at 16:18
  • No, I'm not use skype. But I use reddit that use port 80, can I do something to get the apache2 too ? Unfortunately reddit can be changed to use another port. – Hhaevs May 15 '16 at 16:22
  • 1
    Only one thing can bind to a port at a time. You'll have to choose between Reddit and Apache if Reddit cannot have a different port. –  May 15 '16 at 16:27

1 Answers1

1

Run netstat as superuser to actually see the process that is using port 80 (like it is telling you basically).

sudo netstat -antp | grep 80