Gentoo Archives: gentoo-user

From: Xav' <xp@××××××××.fr>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] /etc/init.d/apache2 fails, but apache will run
Date: Mon, 29 Sep 2008 11:39:37
Message-Id: 48E0BE5C.9040604@linuxant.fr
In Reply to: RE: [gentoo-user] /etc/init.d/apache2 fails, but apache will run by Adam Carter
1 Adam Carter a écrit :
2 >> On Sunday 28 September 2008 09:26:06 pm Adam Carter wrote:
3 >>> rix adam # /etc/init.d/apache2 start
4 >>> * Starting apache2 ...
5 >>> (98)Address already in use: make_sock: could not bind to
6 >> address 0.0.0.0:80
7 >>> no listening sockets available, shutting down
8 >>> Unable to open logs
9 >> [
10 >>> ok ] rix adam #
11 >>>
12 >>> The socket is not in use and log dir perms are ok, and;
13 >>>
14 >>> rix adam # apache2 -f /etc/apache2/httpd.conf
15 >>> rix adam # pgrep -lf apach
16 >>> 17740 apache2 -f /etc/apache2/httpd.conf
17 >>> 17741 apache2 -f /etc/apache2/httpd.conf
18 >>> 17744 apache2 -f /etc/apache2/httpd.conf
19 >>> 17772 apache2 -f /etc/apache2/httpd.conf
20 >>> rix adam #
21 >>>
22 >>> So, how do I troubleshoot this?
23 >> I just did a google search
24 > <SNIP> something else is bound to port 80.
25 >
26 > As stated above - socket 80 is not in use (according to netstat). If there was, "apache2 -f /etc/apache2/httpd.conf" would also fail, would it not?
27
28 Can you please post the output of grep -r Listen /etc/apache2 ... This
29 might help :) IMHO, i think that wehn you start apache manually, you do
30 not define DEFAULT_VHOST which add a Listen 80 directive, so try to
31 start apache manually with the same command line arguments as the init
32 script did it...
33
34 HTH.
35
36 Xav'
37
38 >> Do a "ps -A | grep apache" and see if a stray daemon is
39 >> running around... I
40 >
41 > I did that, there were no apache processes running.
42 >
43 >> not then go to /etc/apache2/vhosts.d and make sure both config files
44 >> are "pointing" to the same host that apache is running on...
45 >
46 > Again, if the config was broken then I'd expect # apache2 -f /etc/apache2/httpd.conf to also fail.
47 >
48 > I'd say the problem is related to how the gentoo stuff starts the daemon, or maybe conf.d/apache2, but nothing below looks unusual to me;
49 >
50 > rix apache2 # grep ^[^#] /etc/conf.d/apache2
51 > APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D PHP5"
52 > CONFIGFILE=/etc/apache2/httpd.conf