You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Eugene <ht...@infosatgeomatica.com> on 2004/09/21 20:34:00 UTC

Re[2]: [users@httpd] Execution of a CGI --> creates a new window on "Windows XP"

Hello Pat, tell the truth I never used perl like executable. It was always
running with Apache. In your case when apperas new window, your script
just calls the parser application perl.exe. But application didnt
do nothing with your script. I think maybe your perl module is configured
incorrectly.
I use this in my httpd.conf on Windows (XP and also 2003):
LoadFile "C:/server/perl/bin/perl58.dll"
LoadModule perl_module modules/mod_perl.so
...
<IfModule mod_perl.c>
PerlRequire "C:/server/apache2/conf/startup.pl"
# for ModPerl::Registry scripts
Alias /perl/ "C:/server/apache2/perl/"
<Location /perl>
  SetHandler perl-script
  PerlResponseHandler ModPerl::Registry
  Options +ExecCGI
  PerlOptions +ParseHeaders
</Location>
</IfModule>

Thats all that you need to run perl on your machine with Apache.
To test if the parser works (maybe something damaged physically), you
can try this O'Reilly's example:
#!perl -l
print       "start main running here";
die         "main now dying here\n";
die         "XXX: not reached\n";
END         { print "1st END: done running"   }
CHECK       { print "1st CHECK: done compiling" }
INIT        { print "1st INIT: started running"  }
END         { print "2nd END: done running"   }
BEGIN       { print "1st BEGIN: still compiling" }
INIT        { print "2nd INIT: started running"  }
BEGIN       { print "2nd BEGIN: still compiling" }
CHECK       { print "2nd CHECK: done compiling" }
END         { print "3rd END: done running"   }

To run it you should call it from your CMD.exe, or from the *.bat
file:
perl C:/location/of/this/script/script.pl
Dont forget to configure properly path to the script.
You can also enter all this and run just in cmd.exe terminal, if
you wish.
If this script works then the problem is with your Apache configuration.

Hope this helps.



Tuesday, September 21, 2004, 9:25:43 AM, you wrote:

> Eugene wrote:

> Thanks  Eugene,


> In fact, the Perl bin path was in the PATH env. variable!
> I tried to  adjust the #! line with the full path of Perl (and use -w
> perl option ) but I still have a new window created, but the title is
> "c:\Perl\bin\perl.exe".

> I've also tried to use "start ..." or "cmd ...", or my script `TT.pl`
directly ->> the title of the window changes ("xxxx\system32\cmd.exe) 
> but  the window is always created!

> Thanks

> Pat.

>>Hello Pat, try to put the path to your Perl/bin in the PATH Environment
>>Variable: C:\server\Perl\bin (for example) or
>>My computer->Properties->Advanced->Environment Variables->Path
>>Add there your perl/bin location.
>>CMD.exe its Windows command line interface (almost like terminal on
>>Linux8-)(dont kill me for that comparison)) When there is no
>>associated with your executables parsers - Windows calls this command
>>interface all the time. If you dont want to change your $PATH then
>>replace #!perl string in your script with
>>#!C:\path\to\your\perl-bin directory\perl. I suggest to use also 'perl -w' instead
>>of just 'perl' especially on Windows.
>>
>>Monday, September 20, 2004, 7:43:15 AM, you wrote:
>>
>>  
>>
>>>Hi,
>>>    
>>>
>>
>>  
>>
>>>I was using Apache V2.0.50-win32-x86, on Windows 98 without any problem
>>>but I encountered the following problem on "Windows XP".
>>>    
>>>
>>
>>  
>>
>>>To summarize, I have a cgi script written in Perl, that calls other
>>>scripts or programs  (see   script example below):
>>>when I run this script from Windows XP Internet Explorer, a new empty
>>>window appears with title "C:\WINDOWS\SYSTEM32\CMD.EXE'.
>>>(this was not the case on Windows 98, neither on Linux).
>>>Why does this window appear?
>>>Is it due to the way I am calling the script (I tried  START "" /B  perl
>>>TT.pl     without any success!!)
>>>Is it due to my configuration file?
>>>    
>>>
>>
>>  
>>
>>>The result is OK but this is really unconfortable because my application
>>>calls cgi script very often.
>>>    
>>>
>>
>>
>>  
>>
>>>Many thanks,
>>>    
>>>
>>
>>  
>>
>>>Pat.
>>>    
>>>
>>
>>
>>  
>>
>>>PS:
>>>Example of scripts : (running AC.cgi leads to open a new empty window !!)
>>>    
>>>
>>
>>  
>>
>>>1/ CGI script (AC.cgi)
>>>    
>>>
>>
>>  
>>
>>>#!perl
>>>print "Content-type: text/html\n\n\n";
>>>print "IN AC \n";
>>>@TAB = `perl TT.pl`;                                      ##### I tried
>>>to use START "" /B  perl TT.pl     without any success!!
>>>print @TAB;
>>>print "END AC \n";
>>>    
>>>
>>
>>  
>>
>>>2/ called Perl program (TT.pl)
>>>    
>>>
>>
>>  
>>
>>>#!perl
>>>print "IN TT \n";
>>>sleep 2;
>>>print "END TT \n";
>>>    
>>>
>>
>>
>>
>>
>>
>>
>>  
>>
>>>---------------------------------------------------------------------
>>>The official User-To-User support forum of the Apache HTTP Server Project.
>>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>>For additional commands, e-mail: users-help@httpd.apache.org
>>>    
>>>
>>
>>
>>
>>  
>>



> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org



-- 
Best regards,
 Eugene                            mailto:httpd.subscribe@infosatgeomatica.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] figuring out bad httpd processes

Posted by Peter Unmack <pe...@unmack.net>.
G'day folks

I am running apache 2.0.49 on hp-ux 11.0.  The server just parses simple
straight forward plain html files with nothing fancy on any of the pages
(a couple of simple bits of java code).  I noticed that when I upgraded
from apache 1.3 that I started having problems with the server crashing.
Seems like individual httpd processes would get hung on something, suck up
massive system resources, and eventually the whole program would crash
requiring a manual restart.  Is there a way I can figure out what is
causing this to crash?  I paid closer attention to the last hung process
and using a calculator back calculated what time the event that hung it
happened, but could find nothing astray in the error or access log files
(eg, there was nothing atypical going on around that time).  My guess is
that there is probably a more accurate way of figuring this out.  At this
stage the only other option I can see is setting up a cron job to stop and
start apache every day to avoid the server being down without me knowing
it (or go back to using 1.3 which ran flawlessly for months without
restart).  Any suggestions would be greatly appreciated.  (Oh, and I did
try searching the archives for clues, but didn't come across anything
obvious).

Thanks
Peter J Unmack
School of Life Sciences
Arizona State University
PO BOX 874601
Tempe AZ 85287-4601, USA
---------------------------------------------------------------
DESERT FISHES RULE: To boldly thrive where no other fish can make it!

Desert Springs Action Committee at http://www.pupfish.net/dsac/
Desert Fishes Council at http://www.desertfishes.org/
Australian Desert Fishes as above just add australia or click on Australia
Australian Freshwater Fish Biogeography at http://www.peter.unmack.net/biogeog/
North American Native Fishes Association at http://www.nanfa.org/
Native Fish Australia at http://www.nativefish.asn.au/

"The biggest cause of trouble in the world today is that the stupid
people are so sure about things and the intelligent folks are so full
of doubts."                                          -Bertrand Russell


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Execution of a CGI --> creates a new window on "Windows XP"

Posted by "Pat. Redivo" <pr...@asetechs.com>.
Eugene wrote:

Hi Eugene

I found out the problem!
It was due to the way I started Apache!
In fact, I was launching Apache with only a single option "-f .../my_config"
and I was missing -k start.

Now, I installed a new service, and I used commands on this service and 
everything is OK.
Nevertheless, the behavior I had, was quite strange, because the http 
server was responding well to my requests, despite the fact of new 
windows created....

Anyway,
Thanks for your help,

Pat.



>Hello Pat, tell the truth I never used perl like executable. It was always
>running with Apache. In your case when apperas new window, your script
>just calls the parser application perl.exe. But application didnt
>do nothing with your script. I think maybe your perl module is configured
>incorrectly.
>I use this in my httpd.conf on Windows (XP and also 2003):
>LoadFile "C:/server/perl/bin/perl58.dll"
>LoadModule perl_module modules/mod_perl.so
>...
><IfModule mod_perl.c>
>PerlRequire "C:/server/apache2/conf/startup.pl"
># for ModPerl::Registry scripts
>Alias /perl/ "C:/server/apache2/perl/"
><Location /perl>
>  SetHandler perl-script
>  PerlResponseHandler ModPerl::Registry
>  Options +ExecCGI
>  PerlOptions +ParseHeaders
></Location>
></IfModule>
>
>Thats all that you need to run perl on your machine with Apache.
>To test if the parser works (maybe something damaged physically), you
>can try this O'Reilly's example:
>#!perl -l
>print       "start main running here";
>die         "main now dying here\n";
>die         "XXX: not reached\n";
>END         { print "1st END: done running"   }
>CHECK       { print "1st CHECK: done compiling" }
>INIT        { print "1st INIT: started running"  }
>END         { print "2nd END: done running"   }
>BEGIN       { print "1st BEGIN: still compiling" }
>INIT        { print "2nd INIT: started running"  }
>BEGIN       { print "2nd BEGIN: still compiling" }
>CHECK       { print "2nd CHECK: done compiling" }
>END         { print "3rd END: done running"   }
>
>To run it you should call it from your CMD.exe, or from the *.bat
>file:
>perl C:/location/of/this/script/script.pl
>Dont forget to configure properly path to the script.
>You can also enter all this and run just in cmd.exe terminal, if
>you wish.
>If this script works then the problem is with your Apache configuration.
>
>Hope this helps.
>
>
>
>Tuesday, September 21, 2004, 9:25:43 AM, you wrote:
>
>  
>
>>Eugene wrote:
>>    
>>
>
>  
>
>>Thanks  Eugene,
>>    
>>
>
>
>  
>
>>In fact, the Perl bin path was in the PATH env. variable!
>>I tried to  adjust the #! line with the full path of Perl (and use -w
>>perl option ) but I still have a new window created, but the title is
>>"c:\Perl\bin\perl.exe".
>>    
>>
>
>  
>
>>I've also tried to use "start ..." or "cmd ...", or my script `TT.pl`
>>    
>>
>directly ->> the title of the window changes ("xxxx\system32\cmd.exe) 
>  
>
>>but  the window is always created!
>>    
>>
>
>  
>
>>Thanks
>>    
>>
>
>  
>
>>Pat.
>>    
>>
>
>  
>
>>>Hello Pat, try to put the path to your Perl/bin in the PATH Environment
>>>Variable: C:\server\Perl\bin (for example) or
>>>My computer->Properties->Advanced->Environment Variables->Path
>>>Add there your perl/bin location.
>>>CMD.exe its Windows command line interface (almost like terminal on
>>>Linux8-)(dont kill me for that comparison)) When there is no
>>>associated with your executables parsers - Windows calls this command
>>>interface all the time. If you dont want to change your $PATH then
>>>replace #!perl string in your script with
>>>#!C:\path\to\your\perl-bin directory\perl. I suggest to use also 'perl -w' instead
>>>of just 'perl' especially on Windows.
>>>
>>>Monday, September 20, 2004, 7:43:15 AM, you wrote:
>>>
>>> 
>>>
>>>      
>>>
>>>>Hi,
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>>>I was using Apache V2.0.50-win32-x86, on Windows 98 without any problem
>>>>but I encountered the following problem on "Windows XP".
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>>>To summarize, I have a cgi script written in Perl, that calls other
>>>>scripts or programs  (see   script example below):
>>>>when I run this script from Windows XP Internet Explorer, a new empty
>>>>window appears with title "C:\WINDOWS\SYSTEM32\CMD.EXE'.
>>>>(this was not the case on Windows 98, neither on Linux).
>>>>Why does this window appear?
>>>>Is it due to the way I am calling the script (I tried  START "" /B  perl
>>>>TT.pl     without any success!!)
>>>>Is it due to my configuration file?
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>>>The result is OK but this is really unconfortable because my application
>>>>calls cgi script very often.
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>>>Many thanks,
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>>>Pat.
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>>>PS:
>>>>Example of scripts : (running AC.cgi leads to open a new empty window !!)
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>>>1/ CGI script (AC.cgi)
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>>>#!perl
>>>>print "Content-type: text/html\n\n\n";
>>>>print "IN AC \n";
>>>>@TAB = `perl TT.pl`;                                      ##### I tried
>>>>to use START "" /B  perl TT.pl     without any success!!
>>>>print @TAB;
>>>>print "END AC \n";
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>>>2/ called Perl program (TT.pl)
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>>>#!perl
>>>>print "IN TT \n";
>>>>sleep 2;
>>>>print "END TT \n";
>>>>   
>>>>
>>>>        
>>>>
>>>
>>>
>>>
>>>
>>> 
>>>
>>>      
>>>
>>>>---------------------------------------------------------------------
>>>>The official User-To-User support forum of the Apache HTTP Server Project.
>>>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>>>For additional commands, e-mail: users-help@httpd.apache.org
>>>>   
>>>>
>>>>        
>>>>
>>>
>>> 
>>>
>>>      
>>>
>
>
>
>  
>
>>---------------------------------------------------------------------
>>The official User-To-User support forum of the Apache HTTP Server Project.
>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>For additional commands, e-mail: users-help@httpd.apache.org
>>    
>>
>
>
>
>  
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org