Apache2 has trouble handling (ip6-)localhost

Bug #285132 reported by Andreas Olsson
This bug report is a duplicate of:  Bug #397393: can't bind to ::1. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Incomplete
Low
Unassigned

Bug Description

Binary package hint: apache2

This problem is related to running Apache2 in Intrepid.

At my workstation at home I like to tell Apache to "Listen localhost:80"
(This I do in ports.conf)

In Intrepid that results in the following error

root@hawat:~# /etc/init.d/apache2 restart
 * Restarting web server apache2
... waiting (98)Address already in use: make_sock: could not bind to address 127.0.0.1:80
no listening sockets available, shutting down
Unable to open logs

This error don't happen if I instead use "Listen 127.0.0.1:80".

It seems as if Apache's problems are related to how the default /etc/hosts in Intrepid defines ::1

In Hardy /etc/hosts says
::1     ip6-localhost ip6-loopback

In Intrepid it is instead
::1     localhost ip6-localhost ip6-loopback

If I change my /etc/hosts back to Hardy-style (::1     ip6-localhost ip6-loopback) I can use "Listen localhost:80" in Apache
without any problems.

Revision history for this message
Mathias Gug (mathiaz) wrote :

A default intrepid hosts files looks like:

::1 ip6-localhost ip6-loopback

I cannot reproduce your issue. How did you install the intrepid system?

Changed in apache2 (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Andreas Olsson (andol) wrote :

Actually, the default value of ::1 might just depend on whatever you use Ubiquity or the Debian Installer.

First of all I downloaded a fresh ubuntu-8.10-server-i386.iso, and followed the "Default install" instructions from http://testcases.qa.ubuntu.com/Install/ServerWhole. That gave me a /etc/hosts containing
"::1 localhost ip6-localhost ip6-loopback"

Then I downloaded a fresh ubuntu-8.10-desktop-i386.iso, and followed the "Ubiquity Whole Install" instructions from http://testcases.qa.ubuntu.com/Install/DesktopWhole. That gave me a /etc/hosts containing
"::1 ip6-localhost ip6-loopback"

This finding actually matches my previous experience. I pretty much always use the Debian Installer, in one way of another. Hence it would make sense that I've only seen the ""::1 localhost ip6-localhost ip6-loopback" version.

Revision history for this message
lirel (m8r-lcodw5) wrote :

as bug #397393 seems to be a duplicate of this bug, one of them should be marked as duplicate.
if 397393 becomes a duplicate this one should inherit its status, as it is currently confirmed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.