Can't start apache... (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
When I run "sudo /usr/sbin/apache2ctl graceful" I get the following message:
httpd not running, trying to 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
When I run "sudo netstat -lnp | grep :80" I get:
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 845/aolserver4-nsd
I assume aolserver is also running? How would I get apache to run?
Solution 1:
You have another webserver running already. You have to stop or kill it before you can start Apache (or change one of them to a non-standard port, ie something other than port 80).
Solution 2:
You have a running process named aolserver4-nsd already bound to 127.0.0.1:80, so apache's attempt to bind to 0.0.0.0:80 was denied. Although at first glance it might appear that there should be no conflict between the two, address 0.0.0.0 is the special "any address", and binding to it actually binds to ALL available network interfaces (including the loopback 127.0.0.1).
There are a number of ways to proceed:
You can stop aolserver4-nsd, so that it releases its bind on 127.0.0.1:80. Then you can start apache, and it should successfully bind to 0.0.0.0:80. If you proceed this way, you can only have one of the two processes running at the same time.
You can configure either aolserver4-nsd or apache to bind to a non-standard port (i.e. one other than port 80). (The Listen directive is what you'll need to configure for apache.) This will allow you to run both processes at the same time.
You can configure apache to bind to a specific address instead of to the special "any address" 0.0.0.0. Of course, you will need to configure apache to Listen to an address that exists on one of your server's network interfaces (but not 127.0.0.1). This will also allow both aolserver4-nsd and apache to run simultaneously.