Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Mar 2002 11:08:06 -0800
From:      "Drew Tomlinson" <drew@mykitchentable.net>
To:        "Dan Nelson" <dnelson@allantgroup.com>
Cc:        "Walter Hop" <walter@binity.com>, <smorton@acm.org>, <questions@FreeBSD.ORG>
Subject:   Re: Showing Uptime Via webpage
Message-ID:  <00c001c1d430$6596b9a0$f82a6ba5@lc.ca.gov>
References:  <Pine.GSO.4.44L0.0203232239500.14624-100000@shell.core.com> <3C9E0754.2010104@verizon.net> <006201c1d423$ee01be00$f82a6ba5@lc.ca.gov> <200203251840.33315@silver.dt1.binity.net> <007a01c1d426$38b2c410$f82a6ba5@lc.ca.gov> <20020325182247.GD14939@dan.emsphone.com> <008401c1d42d$7ad8f420$f82a6ba5@lc.ca.gov> <20020325185056.GE14939@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message -----
From: "Dan Nelson" <dnelson@allantgroup.com>
To: "Drew Tomlinson" <drew@mykitchentable.net>
Cc: "Walter Hop" <walter@binity.com>; <smorton@acm.org>;
<questions@FreeBSD.ORG>
Sent: Monday, March 25, 2002 10:50 AM
Subject: Re: Showing Uptime Via webpage


> In the last episode (Mar 25), Drew Tomlinson said:
> > From: "Dan Nelson" <dnelson@allantgroup.com>
> > > > > [in reply to Drew Tomlinson, Monday 25 March 2002 18:38]
> > > > >
> > > > > > > #!/usr/bin/perl
> > > > > > > print "Content-type: text/plain\n\n";
> > > > > > > system ("uptime");
> > > > > > > exit;
> > > > > >
> > > > > > I tried this just out of curiosity but ran into problems.  I
> > > > > > don't get any errors but I just get a blank web page.
> > > > >
> > > > > What happens if you run "/usr/bin/uptime" instead of "uptime"?
> > > >
> > > > Thanks for your suggestion.  However, "/usr/bin/uptime" makes no
> > > > difference.  The page is still blank.
> > >
> > > Can you print any data at all?   Note that you are generating an
> > > incorrect HTML header; the spec says you must use CRLFs, and some
> > > proxies/browsers may refuse to parse the page.
> >
> > I'm not sure exactly what you mean by "..print any data...".  My web
> > server shows my static pages just fine.  I have a test script that I
>
> If you just have
>
> #!/usr/bin/perl
> print "Content-type: text/plain\r\n\r\n";
> print "Hello, World!\n";
>
> Do you get output?  If not, then chances are all CGIs will fail, and
> you have a generic CGI issue.  If you do, then somehow your
> system("uptime") is failing without logging the error.

The "Hello World" works.  You can see it for yourself at
http://mykitchentable.net/cgi-bin/hello if you wish.

I assumed from your example that to end with the proper CRLF, I needed
to add an '\r'.  Tried that but still no output.  I also tried combining
the system("uptime") with the hello world script but still only got the
"Hello World" output.  So maybe "system" does not work in cgi scripts?
Or do you suspect I have something configured wrong?

Thanks for the education!

Drew


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00c001c1d430$6596b9a0$f82a6ba5>