You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Swen Schillig <SC...@de.ibm.com> on 2004/03/11 13:34:27 UTC

mod_perl 1.99_13

I figured a few strange outputs while running make test
after a successful compilation of mod_perl-1.99-13
saying that
        the server couldn't be started (syntax error at line 27 of 
httpd.conf -> Listen localhost:8xxx) (Linux on i386)
or
        dubios output for most of the tests (Linux on PPC)

I figured that this problem is in relation to an entry in the /etc/hosts.
The entry for the localhost for IPV6 is causing this problem.
If it's commented out everything works fine.
the entry looks like this 

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

and is the standard for all SuSE distros (SuSE Linux and SLES )!

At the moment I can live with this problem but I don't know
the reason behind it, maybe there will be a problem I haven't 
figured by now.
The strange thing is that with mod_perl-1.99_12 everything works fine !!!!

Did anybody experienced the same problem ????

Swen


Re: mod_perl 1.99_13

Posted by Stas Bekman <st...@stason.org>.
Jie Gao wrote:
[...]
>>We need to write a generic function to resolve localhost and make sure that we
>>get an ip and not ::1 on the ipv4 systems. If we get ::1 Apache won't start.
>>Help to accomplish that is very appreciated.
> 
> 
> I have spent some time into this and found some interesting things.
> 
> On a Solaris 9 host with both IPv4 and IPv6 configured, and with the
> following in /etc/nsswitch.conf:
> 
> hosts:      files dns
> ipnodes:    files
> 
> and with the following in /etc/inet/ipnodes (defaults):
> 
> #
> # Internet host table
> #
> ::1             localhost
> 127.0.0.1       localhost
> 
> and with the following in /etc/hosts:
> 
> 127.0.0.1       localhost
> 
> , I did a "ifconfig lo0 inet6 down".
> 
> Now, nslookup localhost resolves to 127.0.0.1 and vice versa.
> (Using /etc/hosts file?)
> 
> "dig" will not resolve it.
> (Not using /etc/hosts?)
> 
> The following piece of perl code succeeds in connecting
> to the daytime port:
> 
> my $proto = getprotobyname('udp');
> socket(SOCKET, PF_INET, SOCK_DGRAM, $proto);
> my $sin = sockaddr_in(13,inet_aton('localhost'));
> connect(SOCKET,$sin) || print "not connected:$!\n";
> 
> (Why and how does perl find the IPv4 interface?)

strace it to see why. e.g. on my machine:

strace perl -le 'use Socket; sockaddr_in(13, inet_aton("localhost"))' ;

open("/etc/host.conf", O_RDONLY)        = 3
[...]
open("/etc/hosts", O_RDONLY)            = 3
read(3, "127.0.0.1\t\tlocalhost.localdomain"..., 4096) = 80


> But ping fails.
> (Only looks into /etc/inet/ipnodes?)

again, strace it - on my machine (linux/ipv4) it also reads from /etc/hosts.

> A piece of puzzle that needs more time to solve it.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: mod_perl 1.99_13

Posted by Stas Bekman <st...@stason.org>.
Swen Schillig wrote:
> I figured a few strange outputs while running make test
> after a successful compilation of mod_perl-1.99-13
> saying that
>         the server couldn't be started (syntax error at line 27 of 
> httpd.conf -> Listen localhost:8xxx) (Linux on i386)
> or
>         dubios output for most of the tests (Linux on PPC)
> 
> I figured that this problem is in relation to an entry in the /etc/hosts.
> The entry for the localhost for IPV6 is causing this problem.
> If it's commented out everything works fine.
> the entry looks like this 
> 
> # special IPv6 addresses
> ::1             localhost ipv6-localhost ipv6-loopback
> 
> and is the standard for all SuSE distros (SuSE Linux and SLES )!
> 
> At the moment I can live with this problem but I don't know
> the reason behind it, maybe there will be a problem I haven't 
> figured by now.
> The strange thing is that with mod_perl-1.99_12 everything works fine !!!!

Yes, it's a known problem. Not mod_perl's but Apache-Test's one. A-T included 
in 1.99_13 for the first time works on the ipv6 systems. Though it seems to 
have problems with those weird setups that run no ipv6, but for some reason 
add ::1 to their localhost list.

We need to write a generic function to resolve localhost and make sure that we 
get an ip and not ::1 on the ipv4 systems. If we get ::1 Apache won't start. 
Help to accomplish that is very appreciated.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html