I modified the wrong file. Since I was debugging I had created many copies of
that script.
Yes your solution works. Thank you.




----- Mail original -----
> De : Mik J <[email protected]>
> À : "[email protected]" <[email protected]>
> Cc : 
> Envoyé le : Vendredi 24 août 2012 23h14
> Objet : Re: Perl script
ran by chrooted apache
> 
> 
> 
>>  De : Sébastien Marie
<[email protected]>
>>  On Fri, Aug 24, 2012 at 06:02:39PM +0100,
Mik J wrote:
>>>   Hello,
>>> 
>>>   I have the following perl script that
works in command line:
>>> 
>>>   [...] 
>>> 
>>>   # ./dns.pl
>>>  
142.244.12.42
>>> 
>>>   [...]
>>> 
>>>   I tried in /var/www/htdocs/cgi/ but
when I access
>>>   http://192.168.1.1/cgi/dns.pl
>>>   I have a blank page
>>> 
>>>   In theory when Apache is
>>>   started it loads Net::DNS so that
dns.pl can use it.
>>> 
>>>   I don't think I'm far
>>>   from the solution
but I'm stuck here. Does anyone have an idea how 
> can 
>>  I make
>>>   it
work ?
>> 
>>  Hi,
>> 
>>  Just a question, the cgi script is the *same* that
the command line script 
> ?
>> 
>>  If yes, you should first print HTTP
headers before the content.
>> 
>>  Try:
>>  print "Content-Type: text/plain";
>>  print "";
>> 
>>  at the start of your script. 
>> 
>>  The command line
should echo:
>>  $ ./dns.pl
>>  Content-Type: text/plain
>> 
>>  142.244.12.42
>>  $ 
> 
> 
> Hello Sebastien,
> 
> Yes there is only one script that is
called dns.pl
> I did what you tell me but the web page remains blank. In
command line it's 
> ok
> # ./dns.pl
> Content-Type: text/plain
>
142.244.12.42
> 
> 
> My apache log tells this
> 192.168.1.11 - -
[24/Aug/2012:23:11:16 +0200] "GET /cgi/dns.pl 
> HTTP/1.1" 200 208

Reply via email to