|
From: Chris H. <ch...@ha...> - 2003-12-03 09:51:03
|
Apache uses perl internally. Jetty does not.
I think Apache is loading some kind of perl networking library which
includes the missing 'gethostbyname ()' function, so that it's already
there when you need it.
If I'm right, you'll have to tell perl about that library explicitly
when using Jetty. This is not a 'Jetty configuration' issue, its
about how you meet your CGI servlet's needs.
I suggest you consult perl / Apache documentation to find out which
library it is you need and how to load it.
HTH
Chris
----- Original Message -----
From: "Craig L. Ching" <cc...@mq...>
To: <jet...@li...>;
<jet...@li...>
Sent: Wednesday, December 03, 2003 7:29 AM
Subject: RE: [Jetty-support] Using gethostbyname in perl cgi
> Remember, this script works fine running from Apache on the same
machine, so the arguments that perl is configured incorrectly probably
aren't valid. It also runs fine from a command prompt as well. I
suspect it's something to do with the environment under which it's
executed. I can try the things you suggest and post them, but I
suspect they aren't the problem. Can anyone confirm that they see the
same thing? That would at least tell me it's not something I've
misconfigured in Jetty. Thanks for the reply!
>
> Cheers,
> Craig
>
> -----Original Message-----
> From: Chris Haynes [mailto:ch...@ha...]
> Sent: Tue 12/2/2003 3:41 PM
> To: jet...@li...
> Cc:
> Subject: Re: [Jetty-support] Using gethostbyname in perl cgi
>
>
>
> Well, the Perl script is loading and running OK, as is Jetty..
>
> I'd say that the Perl 'gethostbyname()' function is not working or
not
> binding properly.
>
> I don't know perl. Is this function intrinsic, or is there some kind
> of library to be loaded. If so, and seeing as you are on Windows,
I'd
> suspect a file upper/lower case problem myself..e.g. e: vs. E:
>
>
> Does Perl give diagnostics? Are they in the jetty log?
>
> Is your output the same if you deliberately misspell the function
e.g.
> 'gethostbynameZZZZ()'?
>
> Chris
>
> ----- Original Message -----
> From: "Craig L. Ching" <cc...@mq...>
> To: <jet...@li...>
> Sent: Tuesday, December 02, 2003 8:58 PM
> Subject: [Jetty-support] Using gethostbyname in perl cgi
>
>
> Hi!
>
> I am running Jetty-4.2.14 on Windows 2000. I am trying to get the
> following perl cgi script to work under jetty:
>
> #!E:/Perl/bin/Perl.exe
>
> $host = "quicksilver";
> ($name,$aliases,$addrtype,$length,@addrs) = gethostbyname($host);
>
> print "Content-Type: text/html\n\n";
> print "<HTML><HEAD><TITLE>Test
gethostbyname</TITLE></HEAD><BODY>\n";
>
> print "Host info: <BR>\n";
>
> print "name = $name<BR>\n";
> print "aliases = $aliases<BR>\n";
> print "addrtype = $addrtype<BR>\n";
> print "length = $length<BR>\n";
> printf "addrs = %d.%d.%d.%d\n", unpack('C4',$addrs[0]);
> print "<BR>";
>
> print "</BODY></HTML>\n";
>
> And I'm getting the following output:
>
> <HTML><HEAD><TITLE>Test gethostbyname</TITLE></HEAD><BODY>
> Host info: <BR>
> name = <BR>
> aliases = <BR>
> addrtype = <BR>
> length = <BR>
> addrs = 0.0.0.0
> <BR></BODY></HTML>
>
> This same script, unmodified, works fine under apache and gives the
> following output:
>
> <HTML><HEAD><TITLE>Test gethostbyname</TITLE></HEAD><BODY>
> name = quicksilver.mqsoftware.com<BR>
> aliases = <BR>
> addrtype = 2<BR>
> length = 4<BR>
> addrs = 10.1.11.75
> <BR></BODY></HTML>
>
> And here is the config file I run:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure
> 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">
>
> <Configure class="org.mortbay.jetty.Server">
>
> <Call name="addListener">
> <Arg>
> <New class="org.mortbay.http.SocketListener">
> <Set name="Port"><SystemProperty name="jetty.port"
> default="8081"/>
> </Set>
> </New>
> </Arg>
> </Call>
>
> <Call name="addWebApplication">
> <Arg>/</Arg>
> <Arg><SystemProperty name="jetty.home"
> default="."/>/qpasa/docroot/</Arg>
> </Call>
>
>
>
>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> ->
> <!-- Build the cgi-bin
> -->
>
>
>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> ->
> <Call name="addContext">
> <Arg>/cgi-bin/*</Arg>
> <Set name="ResourceBase"><SystemProperty name="jetty.home"
> default="."/>/qpasa/cgi-bin/</Set>
> <Call name="addServlet">
> <Arg>Common Gateway Interface</Arg>
> <Arg>/</Arg>
> <Arg>org.mortbay.servlet.CGI</Arg>
> <!-- Set initParams for CGI -->
> <Put name="Path">e:\perl\bin</Put>
> <!-- <Put name="commandPrefix">perl</Put> -->
> <Put name="commandPrefix">perl</Put>
> </Call>
> </Call>
>
> </Configure>
>
> Anyone have a clue what I might have done wrong?
>
> Thanks for any help!
>
> Cheers,
> Craig
> --
> Craig L. Ching
> Chief Product Architect
> IBM Certified Specialist, MQSeries
> IBM Certified Developer, MQSeries
> MQSoftware, Inc.
> (952) 345-8720
> www.mqsoftware.com
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by OSDN's Audience Survey.
> Help shape OSDN's sites and tell us what you think. Take this
> five minute survey and you could win a $250 Gift Certificate.
> http://www.wrgsurveys.com/2003/osdntech03.php?site=
> _______________________________________________
> Jetty-support mailing list
> Jet...@li...
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by OSDN's Audience Survey.
> Help shape OSDN's sites and tell us what you think. Take this
> five minute survey and you could win a $250 Gift Certificate.
> http://www.wrgsurveys.com/2003/osdntech03.php?site=8
> _______________________________________________
> Jetty-support mailing list
> Jet...@li...
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>
> NHuHzJ{jHj{wrwk j ʛӱy~zqz
|