Results 1 to 6 of 6

Thread: Apache

  1. #1
    4play's Avatar knob jockey
    Join Date
    Jan 2003
    Location
    London
    Age
    41
    Posts
    3,824
    im trying to setup apache so i can use it to test cgi scripts in perl locally.

    apache keeps showing me the scripts rather then executing them

    Code:
    #!/usr/bin/perl
    
    print "Content-type:text/html\n\n";
    print <<EndOfHTML;
    <html><head><title>Print Environment</title></head>
    <body>
    EndOfHTML
    
    foreach $key (sort(keys %ENV)) {
        print "$key = $ENV{$key}<br>\n";
    }
    
    print "</body></html>";
    that should work properly especially after i chmod 755. im guessing i have not setup apache properly and yes perl is installed and working

  2. Software & Hardware   -   #2
    shn's Avatar Ð3ƒμ|\|(7
    Join Date
    May 2003
    Posts
    3,568
    pitty...............I was hoping some other linux user would help you. Guess we dont have many anymore

    You need to check your httpd.conf file. Apache is suppose to run the scripts right out the box provided you have the path to your perl interpreter in the httpd conf file. It actually looks for the default path of /usr/bin/perl anyway when the script is fired up. Looks like you have the path right but is it right in your httpd conf file?

    Also check and see your not trying to run the script "outside" of your cgi directory. You need to tell apache to execute the file in the same pace you have the script ......usually that would be your cgi-bin directory if you put it there . B)

    I think hax0r knows a thing or two about perl, cgi, etc, not sure

  3. Software & Hardware   -   #3
    h1
    Guest
    You might have more success by using ScriptAlias in your httpd.conf file instead of a module, but this poses a security risk.

  4. Software & Hardware   -   #4
    4play's Avatar knob jockey
    Join Date
    Jan 2003
    Location
    London
    Age
    41
    Posts
    3,824
    i remember i was following a guide to get cgi working and i have added something to scriptalias already. also all my cgi files are placed inside the cgi-bin.

    better check my httpd.conf file again.

  5. Software & Hardware   -   #5
    cselik's Avatar Poster
    Join Date
    Jan 2004
    Location
    Srbija
    Posts
    67
    Code:
    <IfModule mod_userdir.c>
        UserDir public_html
    </IfModule>
    
    <Directory /home/*/public_html>
        AllowOverride none
        Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCgi
        #Options All
        #PerlSendHeader On
        Addhandler cgi-script .cgi
    ...
    i know i have been looking for the solution for 2 weeks.
    i came up with the config above.
    hope it helps.

  6. Software & Hardware   -   #6
    4play's Avatar knob jockey
    Join Date
    Jan 2003
    Location
    London
    Age
    41
    Posts
    3,824
    cheers cselik that worked a treat.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •