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

[cobalt-users] Help with simple CGI.



I am trying to use a simple counter CGI on my raq3 but when I run it I get
an error that comes up in place of the result in the screen: The server
encountered an internal error or misconfiguration and was unable to complete
your request.

It is a very simple server side include (<!--#exec cgi="counter2.cgi"-->)
and I have it running on other web hosts.  But I am moving gall my sites to
a Raq3 and CGI is giving me fits. Oh and is it possible to make server side
includes run just from an .html page rather than having to specify .shtml
which is a pain if you want to do the SSI on you homepage.

Thanks in advance.

Michael Aronoff - CIIC
ma@xxxxxxxx
Calabasas, CA

Here is the CGI:

#!/usr/bin/perl --'
##########################
# counter 1.0
#
# By Command-O Software
# http://www.command-o.com
#
# Copyright 1996.
# All Rights Reserved
#
#If you find this script useful, we would appreciate a
#donation to keep this service active for the community.
#Command-O Software, P.O. Box 12200, Jackson WY 83002
##########################
#<!--#exec cgi="counter2.cgi"-->
$file = "$ENV{'DOCUMENT_URI'}";
$file =~ s/\//_/g;
open(FILE,"data/$file");
flock (FILE, 2);
$count = <FILE>;
flock (FILE, 8);
close(FILE);

$count++;

open(FILE,">data/$file");
flock (FILE, 2);
print FILE "$count";
flock (FILE, 8);
close(FILE);
print "Content-type: text/html\n\n";
print "$count";
exit;