Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 46660 - Apache: make_sock: could not bind to address 0.0.0.0:80
Summary: Apache: make_sock: could not bind to address 0.0.0.0:80
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-02 20:38 UTC by Kenny Bentley
Modified: 2004-04-06 00:57 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenny Bentley 2004-04-02 20:38:19 UTC
I've had apache working for over a year now without any trouble.. I upgraded from 1.3.x to 2.x just fine, however yesterday when I did an emerge sync && emerge -u world, one thing it did is I remember it updated apache and php, so I updated my config files and restarted apache (like I normally do) -- now I don't remember changing anything in the config files... anyway, when I restarted apache, I noticed the message:

 * 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

no matter what I do, I cannot do anything to get rid of that message until I restart the computer, then I get one shot to start apache, and it's back to that message again. ps x gives no information of lingering apache processes:

  PID TTY      STAT   TIME COMMAND
    1 ?        S      0:04 init [3]
    2 ?        SN     0:00 [ksoftirqd/0]
    3 ?        S<     0:00 [events/0]
    4 ?        S<     0:00 [kblockd/0]
    7 ?        S<     0:01 [pdflush]
    5 ?        S      0:00 [khubd]
    8 ?        S<     0:02 [pdflush]
   10 ?        S<     0:00 [aio/0]
    9 ?        S      0:01 [kswapd0]
    6 ?        S      0:00 [kapmd]
   11 ?        S      0:00 [kseriod]
   12 ?        S<     0:00 [reiserfs/0]
  124 ?        Ss     0:00 /sbin/devfsd /dev
  801 ?        Ss     0:00 /usr/sbin/xinetd -pidfile /var/run/xinetd.pid -stayal
  909 ?        Ss     0:00 metalog [MASTER]
  910 ?        S      0:00 metalog [KERNEL]
 1104 ?        S      0:00 /bin/sh /usr/bin/mysqld_safe
 1233 ?        Ss     0:00 /usr/sbin/sshd
 1325 ?        S      0:00 /usr/lib/courier-imap/authlib/authdaemond.plain start
 1345 ?        S      0:00 /usr/lib/courier-imap/authlib/authdaemond.plain start
 1346 ?        S      0:00 /usr/lib/courier-imap/authlib/authdaemond.plain start
 1347 ?        S      0:00 /usr/lib/courier-imap/authlib/authdaemond.plain start
 1348 ?        S      0:00 /usr/lib/courier-imap/authlib/authdaemond.plain start
 1349 ?        S      0:00 /usr/lib/courier-imap/authlib/authdaemond.plain start
 1360 ?        S      0:00 /usr/lib/courier-imap/couriertcpd -address=0 -stderrl
 1362 ?        S      0:00 /usr/lib/courier-imap/courierlogger imapd-ssl
 1411 ?        Ss     0:00 /usr/sbin/cupsd
 1933 ?        Ss     0:00 /sbin/rpc.statd
 1941 ?        S      0:00 [nfsd]
 1942 ?        S      0:00 [nfsd]
 1943 ?        S      0:00 [nfsd]
 1944 ?        S      0:00 [nfsd]
 1945 ?        S      0:00 [nfsd]
 1946 ?        S      0:00 [nfsd]
 1947 ?        S      0:00 [nfsd]
 1948 ?        S      0:00 [nfsd]
 1950 ?        S      0:00 [lockd]
 1951 ?        S      0:00 [rpciod]
 1954 ?        Ss     0:00 /usr/sbin/rpc.mountd
 2045 ?        Ss     0:00 /usr/lib/postfix/master
 2136 ?        Ss     0:00 /usr/sbin/cron
 2194 tty1     Ss+    0:00 /sbin/agetty 38400 tty1 linux
 2195 tty2     Ss+    0:00 /sbin/agetty 38400 tty2 linux
 2196 tty3     Ss+    0:00 /sbin/agetty 38400 tty3 linux
 2197 tty4     Ss+    0:00 /sbin/agetty 38400 tty4 linux
 2198 tty5     Ss+    0:00 /sbin/agetty 38400 tty5 linux
 2199 tty6     Ss+    0:00 /sbin/agetty 38400 tty6 linux
 2215 ?        Ss     0:00 /usr/kde/3.2/bin/kdm
 2218 ?        S      0:10 /etc/X11/X -nolisten tcp vt7 -auth /var/run/xauth/A:0
 2219 ?        S      0:00 -:0
 2223 ?        S      0:13 /usr/kde/3.2/bin/kdm_greet
 2242 ?        Ss     0:14 sshd: root@pts/0
 2245 pts/0    Ss+    0:00 -bash
19545 ?        Ss     0:06 sshd: root@pts/1
19835 pts/1    Ss     0:00 -bash
22476 ?        Ss     0:00 /usr/sbin/smbd
22478 ?        Ss     0:00 /usr/sbin/nmbd
22495 pts/1    R+     0:00 ps x

After that, I tried downgrading apache back to apache-2.0.48-r4 -- I did that and still the same message. Now, if you remember, I didn't change my configs, which leads me to believe that it's not a problem with apache, but a problem with another package. I'm doing an "emerge -e apache" in hopes to clear it up, but I have my doubts. I'll be willing to give any extra information, please help, this is way over my head...

Thanks,
Kenny



Reproducible: Always
Steps to Reproduce:
1.
2.
3.




server root # emerge info
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 
2.6.5-rc2-mm3)
=================================================================
System uname: 2.6.5-rc2-mm3 i686 Celeron (Mendocino)
Gentoo Base System version 1.4.3.13p1
distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=i686 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.
1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozil
la/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/
texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/p
latex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS=""
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distcc sandbox"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu 
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acpi apache2 apm arts avi crypt cups encode esd foomaticdb freetype gd 
gdbm gif gpm gtk gtk2 guile imagemagick imlib innodb java jpeg kde libg++ 
libwww mad mikmod motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss 
pam pdflib perl png python qt quicktime readline samba sdl slang spell ssl 
svga tcltk tcpd tetex truetype x86 xml2 xmms xv zlib"
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-04-02 23:13:55 UTC
cause the problem again, then include the output of 'netstat -anp' in this bug.
Comment 2 Kenny Bentley 2004-04-03 00:17:19 UTC
even on first run of apache after /etc/init.d/apache2 start, it does not work, but here is the restart:


server root # /etc/init.d/apache2 restart
 * Stopping apache2...                                                                            [ ok ]
 * 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
                                                                                                  [ !! ]

server root # netstat -anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      1374/couriertcpd
tcp        0      0 0.0.0.0:2401            0.0.0.0:*               LISTEN      808/xinetd
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1225/mysqld
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      2130/smbd
tcp        0      0 0.0.0.0:877             0.0.0.0:*               LISTEN      1967/rpc.statd
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1930/portmap
tcp        0      0 0.0.0.0:3632            0.0.0.0:*               LISTEN      1700/distccd
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1329/apache2
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1240/sshd
tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN      1425/cupsd
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      2079/master
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1329/apache2
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      2130/smbd
tcp        0      0 0.0.0.0:895             0.0.0.0:*               LISTEN      1988/rpc.mountd
tcp        0      0 10.10.1.1:139           10.10.27.246:2678       ESTABLISHED 2335/smbd
tcp    67125      0 66.214.183.7:80         66.214.168.107:2969     CLOSE_WAIT  -
tcp        0   1924 66.214.183.7:22         10.10.27.246:2672       ESTABLISHED 1252/0
udp        0      0 0.0.0.0:32768           0.0.0.0:*                           -
udp        0      0 0.0.0.0:2049            0.0.0.0:*                           -
udp        0      0 127.0.0.1:32770         0.0.0.0:*                           2335/smbd
udp        0      0 10.10.1.1:137           0.0.0.0:*                           2132/nmbd
udp        0      0 66.214.183.7:137        0.0.0.0:*                           2132/nmbd
udp        0      0 0.0.0.0:137             0.0.0.0:*                           2132/nmbd
udp        0      0 10.10.1.1:138           0.0.0.0:*                           2132/nmbd
udp        0      0 66.214.183.7:138        0.0.0.0:*                           2132/nmbd
udp        0      0 0.0.0.0:138             0.0.0.0:*                           2132/nmbd
udp        0      0 0.0.0.0:67              0.0.0.0:*                           1636/dhcpd
udp        0      0 0.0.0.0:871             0.0.0.0:*                           1967/rpc.statd
udp        0      0 0.0.0.0:874             0.0.0.0:*                           1967/rpc.statd
udp        0      0 0.0.0.0:111             0.0.0.0:*                           1930/portmap
udp        0      0 0.0.0.0:631             0.0.0.0:*                           1425/cupsd
udp        0      0 0.0.0.0:892             0.0.0.0:*                           1988/rpc.mountd
raw        0      0 0.0.0.0:1               0.0.0.0:*               7           1636/dhcpd
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     3301   1225/mysqld         /var/run/mysqld/mysqld.sock
unix  2      [ ACC ]     STREAM     LISTENING     3410   1339/authdaemond.pl /var/lib/courier-imap/authdaemon/socket.tmp
unix  2      [ ACC ]     STREAM     LISTENING     4292   2079/master         public/cleanup
unix  2      [ ACC ]     STREAM     LISTENING     4299   2079/master         private/rewrite
unix  2      [ ACC ]     STREAM     LISTENING     4303   2079/master         private/bounce
unix  2      [ ACC ]     STREAM     LISTENING     4307   2079/master         private/defer
unix  2      [ ACC ]     STREAM     LISTENING     4311   2079/master         public/flush
unix  2      [ ACC ]     STREAM     LISTENING     4315   2079/master         private/proxymap
unix  2      [ ACC ]     STREAM     LISTENING     4319   2079/master         private/smtp
unix  2      [ ACC ]     STREAM     LISTENING     4323   2079/master         private/relay
unix  2      [ ACC ]     STREAM     LISTENING     4327   2079/master         public/showq
unix  2      [ ACC ]     STREAM     LISTENING     4331   2079/master         private/error
unix  2      [ ACC ]     STREAM     LISTENING     4335   2079/master         private/local
unix  2      [ ACC ]     STREAM     LISTENING     4339   2079/master         private/virtual
unix  14     [ ]         DGRAM                    3016   916/metalog [MASTER /dev/log
unix  2      [ ACC ]     STREAM     LISTENING     4343   2079/master         private/lmtp
unix  2      [ ACC ]     STREAM     LISTENING     4347   2079/master         private/maildrop
unix  2      [ ACC ]     STREAM     LISTENING     4351   2079/master         private/old-cyrus
unix  2      [ ACC ]     STREAM     LISTENING     3397   1329/apache2        /var/run/cgisock
unix  2      [ ACC ]     STREAM     LISTENING     4355   2079/master         private/cyrus
unix  2      [ ACC ]     STREAM     LISTENING     4359   2079/master         private/uucp
unix  2      [ ACC ]     STREAM     LISTENING     4363   2079/master         private/ifmail
unix  2      [ ACC ]     STREAM     LISTENING     4367   2079/master         private/bsmtp
unix  2      [ ]         DGRAM                    4476   2170/cron
unix  2      [ ]         DGRAM                    4431   2132/nmbd
unix  2      [ ]         DGRAM                    4421   2130/smbd
unix  2      [ ]         DGRAM                    4378   2095/qmgr
unix  2      [ ]         DGRAM                    4374   2094/pickup
unix  3      [ ]         STREAM     CONNECTED     4370   2079/master
unix  3      [ ]         STREAM     CONNECTED     4369   2079/master
unix  3      [ ]         STREAM     CONNECTED     4366   2079/master
unix  3      [ ]         STREAM     CONNECTED     4365   2079/master
unix  3      [ ]         STREAM     CONNECTED     4362   2079/master
unix  3      [ ]         STREAM     CONNECTED     4361   2079/master
unix  3      [ ]         STREAM     CONNECTED     4358   2079/master
unix  3      [ ]         STREAM     CONNECTED     4357   2079/master
unix  3      [ ]         STREAM     CONNECTED     4354   2079/master
unix  3      [ ]         STREAM     CONNECTED     4353   2079/master
unix  3      [ ]         STREAM     CONNECTED     4350   2079/master
unix  3      [ ]         STREAM     CONNECTED     4349   2079/master
unix  3      [ ]         STREAM     CONNECTED     4346   2079/master
unix  3      [ ]         STREAM     CONNECTED     4345   2079/master
unix  3      [ ]         STREAM     CONNECTED     4342   2079/master
unix  3      [ ]         STREAM     CONNECTED     4341   2079/master
unix  3      [ ]         STREAM     CONNECTED     4338   2079/master
unix  3      [ ]         STREAM     CONNECTED     4337   2079/master
unix  3      [ ]         STREAM     CONNECTED     4334   2079/master
unix  3      [ ]         STREAM     CONNECTED     4333   2079/master
unix  3      [ ]         STREAM     CONNECTED     4330   2079/master
unix  3      [ ]         STREAM     CONNECTED     4329   2079/master
unix  3      [ ]         STREAM     CONNECTED     4326   2079/master
unix  3      [ ]         STREAM     CONNECTED     4325   2079/master
unix  3      [ ]         STREAM     CONNECTED     4322   2079/master
unix  3      [ ]         STREAM     CONNECTED     4321   2079/master
unix  3      [ ]         STREAM     CONNECTED     4318   2079/master
unix  3      [ ]         STREAM     CONNECTED     4317   2079/master
unix  3      [ ]         STREAM     CONNECTED     4314   2079/master
unix  3      [ ]         STREAM     CONNECTED     4313   2079/master
unix  3      [ ]         STREAM     CONNECTED     4310   2079/master
unix  3      [ ]         STREAM     CONNECTED     4309   2079/master
unix  3      [ ]         STREAM     CONNECTED     4306   2079/master
unix  3      [ ]         STREAM     CONNECTED     4305   2079/master
unix  3      [ ]         STREAM     CONNECTED     4302   2079/master
unix  3      [ ]         STREAM     CONNECTED     4301   2079/master
unix  3      [ ]         STREAM     CONNECTED     4298   2079/master
unix  3      [ ]         STREAM     CONNECTED     4297   2079/master
unix  3      [ ]         STREAM     CONNECTED     4295   2079/master
unix  3      [ ]         STREAM     CONNECTED     4294   2079/master
unix  3      [ ]         STREAM     CONNECTED     4291   2079/master
unix  3      [ ]         STREAM     CONNECTED     4290   2079/master
unix  3      [ ]         STREAM     CONNECTED     4288   2079/master
unix  3      [ ]         STREAM     CONNECTED     4287   2079/master
unix  2      [ ]         DGRAM                    4273   2079/master
unix  2      [ ]         DGRAM                    4090   1967/rpc.statd
unix  2      [ ]         DGRAM                    4012   1930/portmap
unix  2      [ ]         DGRAM                    3803   1700/distccd
unix  2      [ ]         DGRAM                    3741   1636/dhcpd
unix  2      [ ]         DGRAM                    3455   1376/courierlogger
unix  2      [ ]         DGRAM                    3409   1339/authdaemond.pl
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-04-03 00:37:24 UTC
that output shows that apache2 is already running on port 80!

however I don't see it on your process output, and I suspect a kernel bug (there is a bug in some of the 2.6.5-* stuff IIRC)
Comment 4 Kenny Bentley 2004-04-03 01:07:44 UTC
ok, I just restarted using 2.6.3-mm3 (like I had a few weeks ago when it worked) ... still no go... same exact problem... I also noticed when I restarted the computer, I get the following from ps aux:

server root # ps aux | grep apache
apache    1289  0.0  3.5 26552 9116 ?        S    00:56   0:00 /usr/sbin/apache2 -k start -D SSL -D PHP4

and this from netstat:
server root # netstat -anp | grep apache
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1289/apache2
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1289/apache2
unix  2      [ ACC ]     STREAM     LISTENING     3225   1289/apache2        /var/run/cgisock


HOWEVER, even though it says that it's running in both ps and netstat, I still don't get a reply from http://66.214.183.7/ -- and you probably won't either...

server root # ps aux | grep apache
apache    1289  0.0  3.5 26552 9116 ?        S    00:56   0:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
root      2362  0.0  0.1  1512  484 pts/0    S+   01:02   0:00 grep apache
server root # kill 1289
server root # ps aux | grep apache
root      2378  0.0  0.1  1508  448 pts/0    S+   01:03   0:00 grep apache
server root # /etc/init.d/apache2 restart
 * Starting apache2...                                                                            [ ok ]
server root # ps x | grep apache
 2487 pts/0    S+     0:00 grep apache
server root # ps aux | grep apache
apache    2471  0.0  3.5 26552 9116 ?        S    01:05   0:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
root      2492  0.0  0.1  1508  448 pts/0    S+   01:06   0:00 grep apache
server root # ps x | grep 2471
 2497 pts/0    S+     0:00 grep 2471


However it still doesn't work...

BTW, this is all with the 2.6.3-mm3 kernel...

I don't get it... thanks tons for the speedy replies though

Kenny
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-04-03 02:29:28 UTC
try hardened-sources or vanilla-sources, and use a stable kernel (not pre or rc) release from there.

fire up apache2 from the command line directly, with debugging on and see what happens when you connect.
Comment 6 phasma 2004-04-04 07:47:25 UTC
ok, let's go on NOT NEW apache2/system bugs

dear kenny, your trouble is due (i think) to a non-sufficient system entropy in digest generating process.

u could resolve that problem recompiling apache2 with 
--with-devrandom=/dev/urandom 
option, changing from the default /dev/random.

literature says that /dev/urandom is less secure from /dev/random, but i don't want to discuss it here & now.
so the solutions u have are:
- disable digest generating process
- use digest mod and use /dev/urandom

cheers

ph

PS: i MUST say, for true, that i experimented the problem only on gentoo server, but i'm not sure it is a gentoo related problem. gentoo developers, may be, could say more on the argument.
Comment 7 Kenny Bentley 2004-04-05 17:33:24 UTC
thanks phasma!

Well, apache2 is running again (accept when I try running it with -DPHP4 -- for some reason it goes back to not responding.

Well, that's definitely the workaround, but for the source of the bug, I believe it originates from crypto++

-------

Now, I just have to figure out why php isn't runnign. (whole different bug though)
Comment 8 Chuck Short (RETIRED) gentoo-dev 2004-04-05 17:51:53 UTC
Problem resolved.
Comment 9 Kenny Bentley 2004-04-06 00:57:08 UTC
Well, I figured out my problem (if you care)

PHP Warning:  [Turck MMCache] This build of "Turck MMCache" was compiled for PHP version 4.3.4. Rebuild.
 in Unknown on line 0
PHP Fatal error:  Unable to start Turck MMCache module in Unknown on line 0

When I upgraded php, it didn't recompile turck, so I got errors... Perhaps this is a bug and other's may have this problem other than me.

THANKS AGAIN!

Kenny