UBB.Dev
Posted By: AKD96 cgi & shtml on WinNT Server - 03/26/2003 11:46 PM
One of the Lieutenants here (I work at a Naval base) wants to put a counter on several pages of this department's Intranet. The webpages reside on a Windows NT Server. The reason I am coming here for help is because I am only familiar with Unix and Linux servers.

I have installed Perl on the server so I can run a counter script. I have hit a roadblock when it comes to shtml, though. I want to use an include statement
Code
<!--#exec cgi="e:\textcounter.cgi"-->
to call the counter. First of all, is that the correct format for a Windows box? Anyway, in order for the include to work, it of course has to be in an shtml file. I can't seem to get the server to recognize an shtml file extension. How do I go about doing that? Also, for the path to perl in a .cgi file residing on said Windows server, is
Code
#!e:\perl
the correct way?

Thanks for reading this far.

:Update:

Okay. It seems the problem is with the call. I can pull up the file (counter.shtml) from a remote machine, but the counter is not displaying. Here is the source for counter.shtml:
Code
<html> <br /> <br />test <br /> <br /><!--#exec cgi="\textcounter.cgi"--> <br /> <br /></html>


The file textcounter.cgi resides in the same folder as counter.shtml. It seems that the script is not running. I have installed Perl and was able to run a test .pl script. Any ideas on what I'm missing? Do I need to setup a .htaccess file? If so, where? I've tried putting it right with the other files. Here is what I put in it:
Code
AddType text/html .shtml <br />AddHandler server-parsed .shtml <br />Options Indexes FollowSymLinks Includes


*pulling out hair*
Posted By: Astaran Re: cgi & shtml on WinNT Server - 03/27/2003 12:49 AM
You may have a look at these two sites.
Especially the one about cgi. Your shtml config seems to be correct but i'm not sure about cgi.

http://www.thesitewizard.com/archive/apache.shtml
http://www.thesitewizard.com/archive/addcgitoapache.shtml
Posted By: AKD96 Re: cgi & shtml on WinNT Server - 03/27/2003 1:01 AM
Well, I now know that SSI is not setup correctly. I don't know if that's the only problem, or just one of few. Thanks for the links. I'm going to check them out now.

Update:

While I'm browsing over everything, biting my nails, and chain-smoking - if anyone knows of an easier way, it would be greatly appreciated.
Posted By: navaho Re: cgi & shtml on WinNT Server - 03/27/2003 1:39 AM
You do realize, don't you, that if your are using IIS on that WinNT box that .htaccess doesn't work? Your .htaccess and the contents thereof will be ignored if you are using IIS.
Posted By: AKD96 Re: cgi & shtml on WinNT Server - 03/27/2003 2:11 AM
Of course I don't know that. Like I said, I am absolutely ignorant when it comes to Windows servers. I'm working with Apache now to see if I can get something going with it.... Instead of .htaccess.... it's httpd.conf, right? I'm learning already!
Posted By: navaho Re: cgi & shtml on WinNT Server - 03/27/2003 3:40 AM
Yes, though if you are using apache an .htaccess file WILL work, even on WinNT
Posted By: AKD96 Re: cgi & shtml on WinNT Server - 03/27/2003 3:53 AM
Okay, I've thrown Apache aside for now, and am just using IIS. I'm able to enter the IP and connect to the Intranet. I created a test.shtml file in the root, brought it up in my broswer, and get this...

[]Cannot #EXEC '/cgi/textcounter.cgi' due to lack of EXECUTE permission[/]

Here is the simple source code:

Code
<html> <br /> <br /><!--#exec cgi="/cgi/textcounter.cgi"--> <br /> <br /></html>


So this is where I am now.

Update:

Oh yeah, I have execute set for EVERYONE for the cgi folder AND the cgi file. Still doesn't work...
Posted By: AKD96 Re: cgi & shtml on WinNT Server - 03/27/2003 5:27 AM
Problem solved!!!!!!!!!!!

I deserve a cigarette. I wound up installing FrontPage extensions and doing it that way. Thanks to everyone for their tips and info on the other stuff, though. New knowledge is never wasted.
Posted By: AllenAyres Re: cgi & shtml on WinNT Server - 03/27/2003 5:56 AM
The path to perl is not needed in IIS in scripts. You map extensions instead.

On IIS as well, set the file extension to .shtm

Another thing, set the permissions for the IUSR_machinename acct as well

I think that covered most of your questions

© UBB.Developers