# apache2 not working: no listening sockets available

## Starik

Hi all,

my apache2 isn't working any more. I didn't change something the last days so I#m a bit confused. Restarting is not helping, also re-emerging not.

Here's my error (according to /etc/init.d/apache2 status it's running):

```

elenor dennis # apache2

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

no listening sockets available, shutting down

Unable to open logs

```

```

elenor dennis # emerge info

*** Deprecated use of action 'info', use '--info' instead

Portage 2.1.3.19 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.22-gentoo-r8 i686)

=================================================================

System uname: 2.6.22-gentoo-r8 i686 Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz

Timestamp of tree: Thu, 27 Dec 2007 18:00:01 +0000

ccache version 2.4 [enabled]

app-shells/bash:     3.2_p17

dev-java/java-config: 1.3.7, 2.0.33-r1

dev-lang/python:     2.4.4-r6

dev-python/pycrypto: 2.0.1-r6

dev-util/ccache:     2.4-r7

sys-apps/baselayout: 1.12.10-r5

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.3.16

sys-devel/libtool:   1.5.24

virtual/os-headers:  2.6.23-r2

ACCEPT_KEYWORDS="x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/                                                  php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo "

LINGUAS="de"

MAKEOPTS="-j3"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --st                                                  ats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X acl alsa apache2 avi berkdb bitmap-fonts caps cdparanoia cdr cli cracklib crypt ctype dbus dlloader dri dvd dvdr encode fa                                                  m firefox fortran gdbm gif glitz gpm gtk hal iconv imlib ipod ipv6 ipw3945 isdnlog java jpeg kde latin1 libg++ mad midi mp3 mpeg                                                   mudflap mysql ncurses nls nptl nptlonly nvidia opengl openmp pam pcre pdf pdflib perl png pppd python qt3 qt4 quicktime readline                                                   reflection reiserfs sdl session spell spl ssl svg symlink tcpd truetype truetype-fonts type1-fonts udev unicode win32codecs x86 x                                                  composite xinerama xml xorg xscreensaver xv zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoo                                                  p empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_M                                                  ODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfil                                                  e authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache                                                   filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id user                                                  dir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633

glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="nvidia"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PO                                                  RTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

```

Thanks for any answer!

----------

## poly_poly-man

Did you change anything with the network?

You should set a FQDN hostname (name.network), and make sure that the network (your DHCP server, for example) recognizes it, to be safe.

/etc/hosts should help.

poly-p man

----------

## magic919

You can't run it by just typing apache2, so that's not an error.  Is there anything when you pgrep -fl apache?  Is it really running?  Can you kill it and then /etc/init.d/apache2 start?  What does it say then?

----------

## ctgmao

Hi,

You do not have a folder of logs apache. To be sure applicable run;

```
ls /usr/lib/apache2/ -al 
```

If we have not, run

```
mkdir /var/log/apache2

cd /var/log/

chown -R apache:apache apache2

ln -s /var/log/apache2 /usr/lib/apache2/logs/ 

```

----------

## Hu

Has your IP address changed?  If you configured Apache to listen on a specific IP address and your system no longer has that IP address, then you might have problems starting Apache.

----------

## SKab

Do you have Listen 80 in your httpd.conf ? When I updated my apache that line was gone, added it and now it works.

```

Listen 80

```

----------

## boulli

 *SKab wrote:*   

> Do you have Listen 80 in your httpd.conf ? When I updated my apache that line was gone, added it and now it works.
> 
> ```
> 
> Listen 80
> ...

 

I had the same error as Starik, adding Listen 80 to httpd.conf solved it for me.

----------

