Thank you for your help. I tested the script out on the command line and it worked.
However, I am still having trouble with the localhost thing.
The following is the code I'm trying to execute:
#!C:\perl\bin\perl.exe -w use strict; use CGI; my $query = new CGI; print $query->header( "text/html" ); print <<END_HERE; <html> <head> <title>My First CGI Script</title> </head> <body bgcolor="#FFFFCC"> <h1>This is a pretty lame Web page</h1> <p>Who is this Ovid guy, anyway?</p> </body> </html> END_HERE # must have a line after "END_HERE" or Perl won't recognize # the token
Running that code on the command line produces the following result which seems to have no errors:
C:\Program Files\Apache Group\Apache2\cgi-bin>perl test.cgi Content-Type: text/html; charset=ISO-8859-1 <html> <head> <title>My First CGI Script</title> </head> <body bgcolor="#FFFFCC"> <h1>This is a pretty lame Web page</h1> <p>Who is this Ovid guy, anyway?</p> </body> </html>
The Problem I am having is that I can't even get the apache test page to load when I type http://127.0.0.1 in for the URL.
I set up my httpd.conf file like the following:
# ServerName gives the name and port that the server uses to identify +itself. # This can often be determined automatically, but we recommend you spe +cify # it explicitly to prevent problems during startup. # # If this is not set to valid DNS name for your host, server-generated # redirections will not work. See also the UseCanonicalName directive +. # # If your host doesn't have a registered DNS name, enter its IP addres +s here. # You will have to access it by its address anyway, and this will make + # redirections work in a sensible way. # # 127.0.0.1:80 This didn't work # localhost This also didn't work for me. # ServerName 127.0.0.1
I'm running apache 2.0.48
when I type, http://127.0.0.1/cgi-bin/test.cgi
the browser just continuously tries to load the page like an endless loop. nothing happens.
when I type, http://127.0.0.1
nothing happens. I don't even get the apache test page. do you think that ZoneAlarm will cause a problem with this? I'm also running a router so that a couple of computers in the house can have access to the internet. maybe that is causing the problem. I can't see why that would be causing a problem because I'm not trying to access the internet when I'm running this perl script/cgi stuff. I'm just trying to view the scripts on my own computer.

In reply to Re: Re: setting up a localhost by rebot
in thread setting up a localhost by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.