1

I attempted to restart Apache 2.2.14 (also using PHP 5.3.2 on Ubuntu 10.04, running all commands as root). It shutdown, but will not start back up. This is a brand new VPS with no Firewall or IP Table. When I run apache2ctl start, I get this response:

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

apache2ctl status produces this:

Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/server-status
'www-browser -dump http://localhost:80/server-status' failed.
Maybe you need to install a package providing www-browser or you
need to adjust the APACHE_LYNX variable in /etc/apache2/envvars

lsof | grep http returns nothing

netstat -plant:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1139/mysqld     
tcp        0      0 209.40.198.146:53       0.0.0.0:*               LISTEN      1153/named      
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      1153/named      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1125/sshd       
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      1153/named      
tcp        0    240 209.40.198.146:22       66.214.136.198:37853    ESTABLISHED 1280/0          
tcp6       0      0 :::53                   :::*                    LISTEN      1153/named      
tcp6       0      0 :::22                   :::*                    LISTEN      1125/sshd       
tcp6       0      0 ::1:953                 :::*                    LISTEN      1153/named   

I am a Linux novice at best but everything else I saw asked for these reports. Nothing is blocking port 80 and yet Apache won't bind to it. Is the problem with Apache? I have Virtual Hosts set up but they are pretty straightforward and I have used the same configuration before. I can post .conf files if need be.

apache2ctl -t: Syntac OK

service apache2 start:

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
1
  • Does your server have SELinux enabled?
    – Jenny D
    Jun 12, 2013 at 10:05

2 Answers 2

1

Assuming you're running apache as root (service apache start is better than manual apachectl) because users can't bind privileged ports, please check you have no syntax errors:

apachechtl -t

Then check your NameServer directive configuration and the resolving mechanism.

Be sure your NameServer myhost.example.com refers to an address that can be resolved (check /etc/hosts or your DNS cache).

2
  • I added the logs output for service apache2 start and apachectl -t. There were no syntax errors and the alternate apache start method produced the same results as the first one I tried. It didnt start. Jun 12, 2013 at 9:41
  • So there is truly some process binding to tcp/80, can you run nmap localhost -p 80?
    – fsoppelsa
    Jun 12, 2013 at 12:44
0

This happens if you specify Listen 80 (or some other port) more than once in your configuration. Each time it appears, Apache will try to bind the specified port. On its second appearance, Apache will fail to bind the port because, literally, the address is already in use. Inspect the configuration carefully and remove duplicate Listen directives.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .