Maybe somebody knows what is going on, because i have no more
thoughts.
i repeat that i have no problem with little and lightweight cgi
scripts, which only prints html or doing some more, but not as big
work as the scripts on which everything stops with errors above.
I post here the solution of this problem for me, for searching people.
You can read all discussion here
http://perlmonks.org/?node_id=830448
After this:
So, i made some tests. I generated 200 pages local - right on the
server.
perl simashin.cgi params > file_name.html</p>
The result is :
* Each of 200 pages generates till the end -> </html> without
any
errors. So we can make conclusion, that the cgi script works
fine
* This static generated pages can easily load with browser. So
we make
the conclusion that problems not in content of page.
So the problem can be only in connection(provider, home server,
router, something that i can`t even imagine :) ...) or in apache
Thinking about - how can i find the weak place
I think it is time to some tests with LWP
I wrote simple LWP script, which getting this problem page -
#!/usr/bin/perl
use HTTP::Request::Common;
require LWP::UserAgent;
use Data::Dumper;
$ua = new LWP::UserAgent;
$ua -> timeout(60);
$request = new HTTP::Request ('GET',"http://sitename/script.cgi?
parameter1=value1¶meter2=value2");
$response = $ua -> request($request);
print Dumper($response);
I exec this script in cycle like this-
for i in 1..n; do test.pl > test_$i.html; done
You can do it as you like(right in perl script maybe)
I did something about 200 test, and after it making some changes in
network,apache,router etc... settings, and analyzing the result of
execution.
So i had only ~5% of pages loaded to the end, after day of testing.
So i decided to test apache(doing generation of this page) i edit the
test script and wrote there localhost instead of full domain name, and
run it local.
The apache works good without mistakes, after couple of hours i saw
that 99% of pages was generated to the end...
So apache works fine.
So the problem now can only be in network or network devices.I
thought on my provider first, but my network connection seems to be
good - i have 2-3ms ping and always 10mbit in each direction
connection.
So i begin to trace network, running tcpdump, making loads with
telnet, trying to analyze errors and cases when page stops to
download, but can find nothing.
Network adapters seems works fine too, so i decide to try
connection without my router - dlink dir300(which gives Internet to 3
+wifi computers), the 1 day gone while i made my linux server work
with my provider connection type :D, they(provider) said that it can
be done only through a couple numbers of router or through windows
special program, but it is not true, as always, now i know that i can
do it from linux :D. Arrggghh, about the problem - what do you think
- it is works fine...
So the problem is in this router. Moreover when this errors begins
the first problem device on which i thought - was this router(ugly
little box :) ), because router is closed device(it has only web
interface for settings) and you can`t understand working it or not,
you can`t to know how it actually works, what is the load of it cpu
and so on. But i did not want to test the connection without it,
because of hardness to configure linux server with my provider
connection.
After understanding where is the weak place i gather home network
back(with router), and begin to make some tests, so the problem was -
when the redirection of ports working on router, we have only 5% good
results with this big script, so i remove the redirection for my linux
server(but now it is all open in internet :( ), and now all works
fine
P.S. So, from time i begin a linux user and have linux sysadmin
work, i begin to hate these closed boxes on which you do not have the
full control, but this is progress and for usual users it is great
devices, which easily can be configured... More over if we try to
control all things ourselves in our life we will be crazy :D
P.S.2. Thanks to all who helps me.
P.S.3. I hope this post can help all other who searching the
solution for this apache errors with cgi