I have upgraded from lenny to wheezy and now apache fails to start:

# /etc/init.d/apache2 start                                                                                                                                                             
Starting web server: apache2[Wed May 08 19:01:08 2013] [crit] (22)Invalid argument: alloc_listener: failed to get a socket for (null)
Syntax error on line 17 of /etc/apache2/ports.conf:
Listen setup failed
Action 'start' failed.
The Apache error log may have more information.

Line 17 of ports.conf of course is correct:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

#NameVirtualHost *:80
#Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    Listen 443

<IfModule mod_gnutls.c>
    Listen 443

It looks like it is related to some kernel calls not present in the kernel I am running: http://major.io/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket-for-null/

This is a xen VPS and the kernel version is 2.6.26-amd64. I am as of now unable to update the kernel because the provider needs to do part of that. I already sent a request but I don't know how long they will take.

Is there a way to get this to work until I have a chance to get the kernel updated?

  • 1
    The kernel update is irrelavent. It would have been nice if you would have added line numbers or posted the entire file. The fragement you posted simply doesn't have 17 lines. Can you double check with netstat -ntlp and make sure that there is nothing already listening on port 443. Can you verify the old Apache process is actually dead? Can you post the last few lines from your error log after trying to start Apache? You need more information.
    – Zoredache
    May 9, 2013 at 9:26
  • Posted whole file, it's the default debian ports.conf with Listen 80 commented out by me. The kernel version is relevant because on a system with kernel 2.3.0-amd64 and a similar apache setup it's working fine. In addition another VPS shows the same issue, with the same kernel version (2.2.26).
    – aseq
    May 9, 2013 at 9:36

2 Answers 2


Did you tried this solution, found on ServerFault :

It's about to reinstall libapr1 on your system.




Listen setup failed

Something else is already listening on port 443 (old version of apache perhaps?). Kill it and apache startup will work again.

  • Unfortunately that is not the case.
    – aseq
    May 9, 2013 at 19:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .