[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-developers] Please help with my FIRST CGI/PERL script on RAQ2



I am trying to run my first CGI/PERL script on my Cobalt RAQ2.
 
I have gone into Site Administration and enabled CGI scripts and SSI
 
Do I still have to do the chmod 777 thing?
 
I checked the server and the path to PERL program appears to be /usr/bin/perl
 
I have put the following line in my HTML file to run the script

<!--#exec cgi="cc_log.pl"-->

When I try to run the script by typing cc_log.pl on my browser I get the following message:-

CGIWrap encountered an error while attempting to execute this script:

Error Message: Permission denied
Error Number: 13
This message usually indicates there is a problem with the script itself. The owner of the script needs to check the #! line for correctness.
 
 
 
Here is the script that I am trying to run:-
 
 
!/usr/bin/perl
 
####################################################################
#                                                                  #
#  CC_LOG BY CGI CITY IS A VERY SIMPLE LOGGING PROGRAM WHICH LOGS  #
#  THE HITS TO A SINGLE WEB PAGE. IT COLLECTS INFORMATION          #
#  INCLUDING DATE/TIME OF HIT, BROWSER AGENT USED BY THE VISITOR,  #
#  HOST IP ADDRESSES, AND HTTP REFERRERs (WHENEVER AVAILABLE).     #
#                                                                  #
#  THIS PROGRAM MAY BE USED AND DISTRIBUTED FREELY PROVIDED        #
#  NO MODIFICATIONS ARE MADE TO THE CODE.                          #
#                                                                  #
#  Copyright (c) 1998-1999 - CGI City - All rights reserved        #
#  Author: Peter N. Go - cgicity@xxxxxxxxxx                        #
#                                                                  #
####################################################################
#                                                                  #
#  DISCLAIMER:                                                     #
#  In no event will CGI City be liable to the user of this script  #
#  or any third party for any damages, including any lost profits, #
#  lost savings or other incidental, consequential or special      #
#  damages arising out of the operation of or inability to operate #
#  this script, even if user has been advised of the possibility   #
#  of such damages.                                                #
#                                                                  #
####################################################################
 
####################################################################
#                                                                  #
#  INSTRUCTIONS:                                                   #
#  1. Change the first line of this script to point correctly to   #
#     your host server's Perl interpreter.                         #
#  2. Under the "ASSIGN THE VARIABLES" section below, change the   #
#     2 variables as needed.                                       #
#  3. Upload this script to your cgi-bin directory and chmod it    #
#     to 777                                                       #
#  4. Upload the file named "log.html" to a directory of your      #
#     choice in your web host server. That directory and the file  #
#     must both be chmod 777                                       #
#  5. Insert an SSI call within your HTML code like this:          #
#     <!--#exec cgi="/path/to/cc_log.pl"-->                        #
#  6. To check your logs, simply view the log.html file from your  #
#     favorite browser.                                            #
#     For example: http://yoursite.com/directory/log.html          #
#                                                                  #
#  NOTE:                                                           #
#  This script will only log the hits of the page where it is      #
#  being called from. This is typically usefull for logging hits   #
#  to the main page.                                               #
#                                                                  #
####################################################################
 
#######################
## ASSIGN THE VARIABLES
#######################
 
## ENTER YOUR OWN IP ADDRESS HERE TO AVOID LOGGING YOUR OWN
## HITS WHEN YOU VISIT YOUR OWN SITE; OTHERWISE, LEAVE IT AS IS
 
$me = "0.0.0.0"; 
 
## ENTER THE FULL PATH TO WHERE YOU WILL KEEP THE
## LOG FILES; THIS DIRECTORY AND THE LOG FILE MUST BE
## MUST BE chmod 777
 
$log = "log.html";
 
#############################
## DO NOT EDIT PAST THIS LINE
#############################
 
$getdate = `date +"%D %T %Z"`;
chop ($getdate);
 
if ($ENV{'REMOTE_ADDR'} eq $me) {              
}
 
else {
    open (LOG, ">>$log");
    print "Content-type: text/html\n\n ";
    print LOG " [ <B>Time:</B> $getdate ] - \n";
    print LOG " [ <B>With:</B> $ENV{'HTTP_USER_AGENT'} ] - \n";
    print LOG " [ <B>Host:</B> $ENV{'REMOTE_HOST'} ] - \n";
    print LOG "[ <B>From:</B> <A HREF="" ]<BR>\n\n";
    close (LOG); 
 
}
exit;