0

When I want to start my apache server, it shows me this error:

Starting httpd:

(98) Address already in use: make_sock: could not bind to address [::]:80

(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

[FAILED]

My httpd.conf file:

Listen 8181

As you can see, I have deleted everything else. Still, Apache wants to bind to port 80 which is used by varnish. Any idea how to solve it?

undone
  • 167
  • 1
  • 1
  • 7
  • 1
    Have you verified that the httpd.conf file you edited is [the httpd.conf file apache is using](http://serverfault.com/questions/12968/how-to-find-out-which-httpd-conf-apache-is-using-at-runtime)? – Diogenes deLight Apr 09 '17 at 21:53
  • @DiogenesdeLight Yes. Before deleting the rest of file, I got the list of all included files and checked them for any possible mis-configurations. But no luck. – undone Apr 10 '17 at 00:16
  • What I mean is something different. If you follow the link I posted, you'll see there are various ways to get apache to tell you the path to its config file. Whenever I change a config file, get no errors, and the behavior is unaffected, I like to make sure the file I edited is really the file that the program is using as its config file. I think it's worth checking that, esp. with apache. – Diogenes deLight Apr 10 '17 at 03:50
  • 1
    Apache does not have a default for Listen, so it must be defined somewhere, look deeper and better. – ezra-s Apr 10 '17 at 08:52

1 Answers1

1

First thing to rule out:

  • Apache is using another config file than the one you expect.

Do the following:

  1. Kill whichever httpd process you have running
  2. Start Apache in foreground with explicit conf file /sbin/httpd -f /etc/httpd/conf/httpd.conf -DFOREGROUND

Second thing:

  • Check which other config files are loaded by your httpd.conf

    grep Include /etc/httpd/conf/httpd.conf

  • Find out which of the loaded config files that have Listen directives defined.

    grep -r Listen /etc/httpd/

Some Listen directive somewhere must be hiding from you.

  • I should've deleted this question because problem was installing two instance of apache on the same server (one compiled in custom directory, the other using yum) . There was a conflict between them! – undone Apr 16 '17 at 02:23