Обсуждение: Mirror.php

Поиск
Список
Период
Сортировка

Mirror.php

От
"Dave Page"
Дата:
Hi Alexey,

It's probably because it's late and I'm tired, but I've been banging my
head against the screen for a while now. Do you have any idea what might
be causing the following error when I try to run mirror.php on what will
be the master website?

Dec 03 23:53:35 mirror [info] Mirroring started
Dec 03 23:53:35 mirror [debug] Saving page
http://wwwmaster.postgresql.org/index.html.en
Address family not supported by protocol

No pages actually get saved.

Regards, Dave.

Re: Mirror.php

От
Alexey Borzov
Дата:
Hi,

Dave Page wrote:
> It's probably because it's late and I'm tired, but I've been banging my
> head against the screen for a while now. Do you have any idea what might
> be causing the following error when I try to run mirror.php on what will
> be the master website?
>
> Dec 03 23:53:35 mirror [info] Mirroring started
> Dec 03 23:53:35 mirror [debug] Saving page
> http://wwwmaster.postgresql.org/index.html.en
> Address family not supported by protocol
>
> No pages actually get saved.

I think the script cannot open a socket to wwwmaster.postgresql.org. I am not
quite sure why, but googling for this error message brought up several pages on
incorrectly setup IPv6. That's your box, so only you can probably know in which
particular way it is misconfigured.

Re: Mirror.php

От
"Dave Page"
Дата:

> -----Original Message-----
> From: Alexey Borzov [mailto:borz_off@cs.msu.su]
> Sent: 04 December 2004 11:19
> To: Dave Page
> Cc: pgsql-www@postgresql.org
> Subject: Re: Mirror.php
>
> I think the script cannot open a socket to
> wwwmaster.postgresql.org. I am not quite sure why, but
> googling for this error message brought up several pages on
> incorrectly setup IPv6. That's your box, so only you can
> probably know in which particular way it is misconfigured.

My box, your code! :-) I saw you wrote the Pear modules as well. Anyway,
I noticed the ipv6 stuff as well, but IPv6 is not even installed on that
box. It's not included as a kernel module or compiled in.

I hacked up the following test programs:

  $fp = fopen("http://wwwmaster.postgresql.org/", "r");
  while (!feof($fp))
  {
      echo fgets($fp, 500);
  }
  fclose($fp);

And

  $fp = fsockopen("wwwmaster.postgresql.org", 80);
  $out = "GET / HTTP/1.1\r\n";
  $out .= "Host: wwwmaster.postgresql.org\r\n";
  $out .= "Connection: Close\r\n\r\n";

  fwrite($fp, $out);
  while (!feof($fp)) {
     echo fgets($fp, 128);
  }
  fclose($fp);

Both of which work exactly as expected on wwwmaster, which is fairly
conclusive that the ipv4 sockets and http code in fopen are working fine
- so, any idea what it is that the Pear code might be doing that is
throwing this error? If we can figure that out, I stand more of a chance
of solving the problem :-)

Regards, Dave.

Re: Mirror.php

От
Alexey Borzov
Дата:
Hi,

Dave Page wrote:
> My box, your code! :-) I saw you wrote the Pear modules as well. Anyway,
> I noticed the ipv6 stuff as well, but IPv6 is not even installed on that
> box. It's not included as a kernel module or compiled in.
>
> I hacked up the following test programs:
>
>   $fp = fsockopen("wwwmaster.postgresql.org", 80);
>   $out = "GET / HTTP/1.1\r\n";
>   $out .= "Host: wwwmaster.postgresql.org\r\n";
>   $out .= "Connection: Close\r\n\r\n";
>
>   fwrite($fp, $out);
>   while (!feof($fp)) {
>      echo fgets($fp, 128);
>   }
>   fclose($fp);
>
> Both of which work exactly as expected on wwwmaster, which is fairly
> conclusive that the ipv4 sockets and http code in fopen are working fine
> - so, any idea what it is that the Pear code might be doing that is
> throwing this error? If we can figure that out, I stand more of a chance
> of solving the problem :-)

::scratches head::
Well, the PEAR code boils down to the example above if you strip all the pretty
stuff out. Please try running the following script, maybe it will give some insight:

<?php
error_reporting(E_ALL);
var_dump(gethostbyname('wwwmaster.postgresql.org'));

require_once 'HTTP/Request.php';
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'var_dump');
$req =& new HTTP_Request('http://wwwmaster.postgresql.org/');
$req->sendRequest();
?>

Re: Mirror.php

От
"Dave Page"
Дата:

> -----Original Message-----
> From: Alexey Borzov [mailto:borz_off@cs.msu.su]
> Sent: 04 December 2004 18:35
> To: Dave Page
> Cc: pgsql-www@postgresql.org
> Subject: Re: [pgsql-www] Mirror.php
>
> ::scratches head::
> Well, the PEAR code boils down to the example above if you
> strip all the pretty stuff out. Please try running the
> following script, maybe it will give some insight:
>
> <?php
> error_reporting(E_ALL);
> var_dump(gethostbyname('wwwmaster.postgresql.org'));
>
> require_once 'HTTP/Request.php';
> PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'var_dump'); $req
> =& new HTTP_Request('http://wwwmaster.postgresql.org/');
> $req->sendRequest();
> ?>
>

root@developer:/usr/local/www/wwwmaster.postgresql.org/www/tools# php -d
include_path=/usr/local/www/portal.postgresql.org/pear/lib test3.php
string(13) "194.217.48.42"
root@developer:/usr/local/www/wwwmaster.postgresql.org/www/tools#

Regards, Dave.

Re: Mirror.php

От
Alexey Borzov
Дата:
Hi,

Dave Page wrote:
>>::scratches head::
>>Well, the PEAR code boils down to the example above if you
>>strip all the pretty stuff out. Please try running the
>>following script, maybe it will give some insight:
>>
>><?php
>>error_reporting(E_ALL);
>>var_dump(gethostbyname('wwwmaster.postgresql.org'));
>>
>>require_once 'HTTP/Request.php';
>>PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'var_dump'); $req
>>=& new HTTP_Request('http://wwwmaster.postgresql.org/');
>>$req->sendRequest();
>>?>
>>
>
> root@developer:/usr/local/www/wwwmaster.postgresql.org/www/tools# php -d
> include_path=/usr/local/www/portal.postgresql.org/pear/lib test3.php
> string(13) "194.217.48.42"
> root@developer:/usr/local/www/wwwmaster.postgresql.org/www/tools#

If that particular script produces no errors, I can't imagine anything that
prevents mirror.php from running... Please try running that again, maybe the
problem just magically went away.

Re: Mirror.php

От
"Dave Page"
Дата:

> -----Original Message-----
> From: Alexey Borzov [mailto:borz_off@cs.msu.su]
> Sent: 04 December 2004 22:21
> To: Dave Page
> Cc: pgsql-www@postgresql.org
> Subject: Re: [pgsql-www] Mirror.php
>
> If that particular script produces no errors, I can't imagine
> anything that prevents mirror.php from running... Please try
> running that again, maybe the problem just magically went away.

WTF?! It's screaming through the pages...

I wonder what the heck was causing that? Oh well, thanks Alexey.

Regards, Dave.

Re: Mirror.php

От
"Dave Page"
Дата:

> -----Original Message-----
> From: pgsql-www-owner@postgresql.org
> [mailto:pgsql-www-owner@postgresql.org] On Behalf Of Dave Page
> Sent: 04 December 2004 22:32
> To: Alexey Borzov
> Cc: pgsql-www@postgresql.org
> Subject: Re: [pgsql-www] Mirror.php
>
> WTF?! It's screaming through the pages...
>
> I wonder what the heck was causing that? Oh well, thanks Alexey.

FYI:

Dec 04 22:44:14 mirror [info] Mirroring finished. 8346 page(s) saved,
904 second(s) spent

Probably would have been quicker if it wasn't streaming verbose output
across the net at me.

/D