Need help in Perl and Apache

Discussion in 'Scripts' started by rkdayan, Jul 20, 2006.

  1. #1
    This is perl for the ActivePerl compiler on Windows XP machine. The browser is producing this error: Cannot find server or DNS Error Internet Explorer. Is there something wrong with the Perl code below? The perl compiler works in DOS shell, but the page isnot viewed in the browser.

    #!C:"\Program Files\Apache Software Foundation\Apache2.2\usr\bin\perl.exe"
    # hello.pl -- my first perl script!

    print "Content-type: text/html\n\n";

    print <<"EOF";
    <HTML>

    <HEAD>
    <TITLE>Hello, world!</TITLE>
    </HEAD>

    <BODY>
    <H1>Hello, world!</H1>
    </BODY>

    </HTML>
    EOF

    Cheers Raj.:)
     
    rkdayan, Jul 20, 2006 IP
  2. nevetS

    nevetS Evolving Dragon

    Messages:
    2,544
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    135
    #2
    The perl script is fine. It probably has something either to do with windows permissions or apache configuration.

    The perl script should be in a directory that is defined as a ScriptAlias i.e.
    ScriptAlias /perl/ "c:\inetpub\www\cgi"
    Code (markup):
    Then you should be able to run http://localhost/perl/hello.pl

    You may also need to set execute permissions on the file and directory.

    Check your error log, it will tell you exactly what is wrong. If you've made configuration changes to apache, it needs to be restarted.
     
    nevetS, Jul 20, 2006 IP