Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 3 of 3

This is a discussion on Reading html/txt in cgi-bin in the Shared & Semi-Dedicated forum
Simple question. I have a Perl script that creates a log.txt file. I want to create a link to that log file (i.e.: <a href="cgi-bin/log.txt">Click ...

  1. #1
    Loyal Client
    Join Date
    Aug 2002
    Posts
    269

    Reading html/txt in cgi-bin

    Simple question. I have a Perl script that creates a log.txt file. I want to create a link to that log file (i.e.: <a href="cgi-bin/log.txt">Click to view log</a> ), but when I do that, I get an "Internal Server Error". Same with trying to access an .html file within cgi-bin.

    I played around with permissions, but nothing I do seems to make any difference. Can it be done?

    Thanks
    Sam

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    The way the cgi-bin is set up, the server will try to execute anything that you put in it, regardless file extension. When you try to access the log file, the server is trying to execute it, but since the file isn't a program, its not having any luck, thus the error.

    There are two things you can do:
    1) change the script so that the log file gets written to a place that isn't in cgi-bin.

    2) Change the location of the script. If the script ends in .pl or .cgi it can be run as a cgi from any directory. The log file will be accessible from any directory except cgi-bin.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  3. #3
    Loyal Client
    Join Date
    Aug 2002
    Posts
    269
    Thanks for the quick response. I was under the impression that Perl scripts (cgi, pl) would only run under the cgi-bin folder.

    Sam

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
  •