public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] /etc/init.d/apache2 fails, but apache will run
@ 2008-09-29  1:26 Adam Carter
  2008-09-29  2:00 ` Jerry McBride
  2008-09-29 15:11 ` Simon
  0 siblings, 2 replies; 5+ messages in thread
From: Adam Carter @ 2008-09-29  1:26 UTC (permalink / raw
  To: gentoo-user@lists.gentoo.org

rix adam # /etc/init.d/apache2 start
 * Starting apache2 ...
(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                                                       [ ok ]
rix adam #

The socket is not in use and log dir perms are ok, and;

rix adam # apache2 -f /etc/apache2/httpd.conf
rix adam # pgrep -lf apach
17740 apache2 -f /etc/apache2/httpd.conf
17741 apache2 -f /etc/apache2/httpd.conf
17744 apache2 -f /etc/apache2/httpd.conf
17772 apache2 -f /etc/apache2/httpd.conf
rix adam #

So, how do I troubleshoot this?





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] /etc/init.d/apache2 fails, but apache will run
  2008-09-29  1:26 [gentoo-user] /etc/init.d/apache2 fails, but apache will run Adam Carter
@ 2008-09-29  2:00 ` Jerry McBride
  2008-09-29  2:17   ` Adam Carter
  2008-09-29 15:11 ` Simon
  1 sibling, 1 reply; 5+ messages in thread
From: Jerry McBride @ 2008-09-29  2:00 UTC (permalink / raw
  To: gentoo-user

On Sunday 28 September 2008 09:26:06 pm Adam Carter wrote:
> rix adam # /etc/init.d/apache2 start
>  * Starting apache2 ...
> (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                                                       [
> ok ] rix adam #
>
> The socket is not in use and log dir perms are ok, and;
>
> rix adam # apache2 -f /etc/apache2/httpd.conf
> rix adam # pgrep -lf apach
> 17740 apache2 -f /etc/apache2/httpd.conf
> 17741 apache2 -f /etc/apache2/httpd.conf
> 17744 apache2 -f /etc/apache2/httpd.conf
> 17772 apache2 -f /etc/apache2/httpd.conf
> rix adam #
>
> So, how do I troubleshoot this?

I just did a google search on the error "(98)Address already in use: 
make_sock: could not bind to address 0.0.0.0:80
> no listening sockets available, shutting down" and it turned up so much that 
I just don't even feel like reading it for you...

What I suspect and what's mentioned in the pages that google turned up, 
something else is bound to port 80. 

Do a "ps -A | grep apache" and see if a stray daemon is running around... i 
not then go to /etc/apache2/vhosts.d and make sure both config files 
are "pointing" to the same host that apache is running on...

That's where I would start. 


-- 

*****************************************************************************
                                       
                             From the desk of:
                             Jerome D. McBride
                                       
    21:56:02 up 1 day,  2:13,  5 users,  load average: 0.14, 0.07, 0.02
 
*****************************************************************************



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [gentoo-user] /etc/init.d/apache2 fails, but apache will run
  2008-09-29  2:00 ` Jerry McBride
@ 2008-09-29  2:17   ` Adam Carter
  2008-09-29 11:39     ` Xav'
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Carter @ 2008-09-29  2:17 UTC (permalink / raw
  To: gentoo-user@lists.gentoo.org


> On Sunday 28 September 2008 09:26:06 pm Adam Carter wrote:
> > rix adam # /etc/init.d/apache2 start
> >  * Starting apache2 ...
> > (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
>               [
> > ok ] rix adam #
> >
> > The socket is not in use and log dir perms are ok, and;
> >
> > rix adam # apache2 -f /etc/apache2/httpd.conf
> > rix adam # pgrep -lf apach
> > 17740 apache2 -f /etc/apache2/httpd.conf
> > 17741 apache2 -f /etc/apache2/httpd.conf
> > 17744 apache2 -f /etc/apache2/httpd.conf
> > 17772 apache2 -f /etc/apache2/httpd.conf
> > rix adam #
> >
> > So, how do I troubleshoot this?
>
> I just did a google search
<SNIP> something else is bound to port 80.

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?

> Do a "ps -A | grep apache" and see if a stray daemon is
> running around... I

I did that, there were no apache processes running.

> not then go to /etc/apache2/vhosts.d and make sure both config files
> are "pointing" to the same host that apache is running on...

Again, if the config was broken then I'd expect # apache2 -f /etc/apache2/httpd.conf to also fail.

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;

rix apache2 # grep ^[^#] /etc/conf.d/apache2
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST  -D PHP5"
CONFIGFILE=/etc/apache2/httpd.conf





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] /etc/init.d/apache2 fails, but apache will run
  2008-09-29  2:17   ` Adam Carter
@ 2008-09-29 11:39     ` Xav'
  0 siblings, 0 replies; 5+ messages in thread
From: Xav' @ 2008-09-29 11:39 UTC (permalink / raw
  To: gentoo-user

Adam Carter a écrit :
>> On Sunday 28 September 2008 09:26:06 pm Adam Carter wrote:
>>> rix adam # /etc/init.d/apache2 start
>>>  * Starting apache2 ...
>>> (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
>>               [
>>> ok ] rix adam #
>>>
>>> The socket is not in use and log dir perms are ok, and;
>>>
>>> rix adam # apache2 -f /etc/apache2/httpd.conf
>>> rix adam # pgrep -lf apach
>>> 17740 apache2 -f /etc/apache2/httpd.conf
>>> 17741 apache2 -f /etc/apache2/httpd.conf
>>> 17744 apache2 -f /etc/apache2/httpd.conf
>>> 17772 apache2 -f /etc/apache2/httpd.conf
>>> rix adam #
>>>
>>> So, how do I troubleshoot this?
>> I just did a google search
> <SNIP> something else is bound to port 80.
> 
> 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?

Can you please post the output of grep -r Listen /etc/apache2 ... This 
might help :) IMHO, i think that wehn you start apache manually, you do 
not define DEFAULT_VHOST which add a Listen 80 directive, so try to 
start apache manually with the same command line arguments as the init 
script did it...

HTH.

Xav'

>> Do a "ps -A | grep apache" and see if a stray daemon is
>> running around... I
> 
> I did that, there were no apache processes running.
> 
>> not then go to /etc/apache2/vhosts.d and make sure both config files
>> are "pointing" to the same host that apache is running on...
> 
> Again, if the config was broken then I'd expect # apache2 -f /etc/apache2/httpd.conf to also fail.
> 
> 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;
> 
> rix apache2 # grep ^[^#] /etc/conf.d/apache2
> APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST  -D PHP5"
> CONFIGFILE=/etc/apache2/httpd.conf





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] /etc/init.d/apache2 fails, but apache will run
  2008-09-29  1:26 [gentoo-user] /etc/init.d/apache2 fails, but apache will run Adam Carter
  2008-09-29  2:00 ` Jerry McBride
@ 2008-09-29 15:11 ` Simon
  1 sibling, 0 replies; 5+ messages in thread
From: Simon @ 2008-09-29 15:11 UTC (permalink / raw
  To: gentoo-user

Have you done an upgrade/update of apache lately?

Whenever apache gets updated here, two files are recreated each time.
If you look in /etc/apache2, it should look like this:

-rw-r--r-- 1 root root  6311 Sep  2 03:23 httpd.conf
-rw-r--r-- 1 root root 12958 Sep  8 16:52 magic
drwxr-xr-x 2 root root  4096 Sep  8 22:50 modules.d
drwxr-xr-x 2 root root  4096 Sep  8 16:53 ssl
drwxr-xr-x 2 root root  4096 Sep 16 07:59 vhosts.d

Reading through httpd.conf, you should find the lines:
----
# Virtual-host support
#
# Gentoo has made using virtual-hosts easy. In /etc/apache2/vhosts.d/ we
# include a default vhost (enabled by adding -D DEFAULT_VHOST to
# APACHE2_OPTS in /etc/conf.d/apache2).
Include /etc/apache2/vhosts.d/*.conf
----

And looking through /etc/apache2/vhosts.d/, you should find all your own virtual 
servers, I name mine as per the port they use:

-rwxr-xr-x 1 root root  565 Sep  1 07:55 80.conf
-rwxr-xr-x 1 root root  368 Sep 16 07:57 8080.conf
-rw-r--r-- 1 root root 2.8K Sep  8 16:52 default_vhost.include

I don't have the two files that are recreated each time here, but they contain a 
configuration similar to the one in my 80.conf.  Thus, it load my 80.conf, and 
then tries to load its own default_80.conf (or something like that) and 
conflicts since the port 80 is already in use (by another vhost).

2 ways to solve this:  either use those default file names for your own vhost 
configuration so portage will ask you to update /etc files interactively, or 
delete those 2 files each and every time you update apache.  I have never looked 
into that but maybe by removing the option -D DEFAULT_VHOST in you 
/etc/conf.d/apache2 might do the trick also.

HTH,
   Simon


Adam Carter wrote:
> rix adam # /etc/init.d/apache2 start
>  * Starting apache2 ...
> (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                                                       [ ok ]
> rix adam #
> 
> The socket is not in use and log dir perms are ok, and;
> 
> rix adam # apache2 -f /etc/apache2/httpd.conf
> rix adam # pgrep -lf apach
> 17740 apache2 -f /etc/apache2/httpd.conf
> 17741 apache2 -f /etc/apache2/httpd.conf
> 17744 apache2 -f /etc/apache2/httpd.conf
> 17772 apache2 -f /etc/apache2/httpd.conf
> rix adam #
> 
> So, how do I troubleshoot this?
> 
> 
> 
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-09-29 19:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-29  1:26 [gentoo-user] /etc/init.d/apache2 fails, but apache will run Adam Carter
2008-09-29  2:00 ` Jerry McBride
2008-09-29  2:17   ` Adam Carter
2008-09-29 11:39     ` Xav'
2008-09-29 15:11 ` Simon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox