Why isn't my counter working?!
Hey all, i'm still in training as far as perl and cgi are concerned, so please hear me out.
I downloaded a counter script from htmlgoodies.com and uploaded it to my site, (you can see the modified script at tcnj.edu/~jpnclub/cgi-bin/countcgi.cgi
the page i'm trying to get a count for is tcnj.edu/~jpnclub/index.html)
I modified the file according to the instructions provided with it- i telnetted into the server, went to the appropriate folder, used the "pwd" command to get the appropriate absolute path, did chmod 775 on all relevant files and folders. I confirmed that the perl program is located in the stardard place on the server (/usr/bin/perl). I've been going over this whole thing for hours, still no luck, i'm getting rather frustrated to say the least. any help would be greatly appreciated
You need to attach the script source code. All that link does is 'run' the script.
Originally Posted by fox1324
You should chmod to 755 not 775 (althought your script should still run).
Did you telnet in ACSII mode. If BINARY, it will not work.
That said, when I attempt to access the above link, I get a 'page not found' error which indicates the your script is NOT in the cgi-bin directory or it's not named 'countcgi.cgi'.
my bad! at the end of the night, i changed the script's extension to .pl to see if that would make things work...it didnt. forgot to change it back, thats why you couldnt see the script. the full script is now available at http://www.tcnj.edu/~jpnclub/cgi-bin/countcgi.cgi .
Originally Posted by Nedals
the relevant lines of code are:
EDIT: also, i chmod'd everything to 755, still no luck. and the script was uploaded in ascii mode. (as far as i can tell)
$minLen = 7;
#This is absolute path of the directory where the counter files are stored. Must be global-writeable.
$counterdir = "/home/acct3/jpnclub/www/counts";
That is not a well written script.
This does not look correct, but it might be, and it should be on line 1. Check to be sure.
The link you provided should have run the script, not return the source code. Do you have any other cgi scripts running on your server?
Try this, using the more usual shebang line...
save as 'test.cgi' in your cgi-bin directory and chmod 755
print "Content-type: text/plain\n\n";
print "Hello World\n";
run with 'cnj.edu/~jpnclub/cgi-bin/test.cgi' in the address bar.
Then modify, and run, the script with the following..
If that works, which it should, I'll explain and show you how to modify your script
my $q = CGI->new();
print "Hello World\n";
I notice that in your last reply, the shebang line is as follows..
Which is it??
Last edited by Nedals; 12-08-2005 at 01:09 AM.
i believe you will need perl5 to run cgi reliably. so on telnet do a "whereis perl" and "whereis perl5"...
your perl installations on your webserver and the apache server shoudl have cgi installed, but it may not... also, i think since your not actually running in the servers real cgi-bin, you may have to reference 'cgi-lib.pl'.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)