Apache comes pretty much pre-configured witht he ability to run Perl scripts that are 1) In it's cgi-bin directory, and 2)have the #! on the first line pointing to where your perl executable is. This is it's standard and recommended configuration. If you have another directory you want to run scripts from, you'll need to configure Apache to use it, likewise, there's an option to have Apache (on Win32 platforms, which is what I'm assuming you're using here) use the Registry/file extention setting insead of the #! setting -- but I don't necessarly recommend it.

So, for you, all you should need to do is install the latest Win32-based version of Apache, then Perl precompiled for Win32. When you install Perl, make a note of what directory Perl is installed into, then, after the install, go into it, then go into the bin\ directory, and find the file Perl.exe. Then go into where Apache is installed, find the cgi-bin directory, then find a file printenv.pl. Open that file in a text editor, and chage the top line as described above. Forinstance, if the location of your Perl executable is c:\Perl\bin\Perl.exe, you'd put #!c:\perl\bin\perl.exe as the top line.

Run printenv.pl in your web browser like any other cgi script, and be amazed. That's the basics, and I HIGHLY recommend you check out Apache's own documetation on the subject -- it's clearly written, and will guide you well if you have patience with it. Good luck.

----Asim, known to some as Woodrow.


In reply to Re: Perl, PHP, and Apache by Asim
in thread Perl, PHP, and Apache by Kiko

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.