Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Silly CGI problem 1

Status
Not open for further replies.

billieT

MIS
Dec 11, 2001
107
0
0
NZ
I'm trying to call a cgi-script from a standard html file, and for some reason, nothing is displaying and nothing shows up in the logs.

The background is that I am running the Mailgraph cgi script on my server (in the cgi-bin directory), and I would like it to display (it outputs pretty graphs) when people visit rather than
I'm probably going about this completely the wrong way (I know nothing about CGI), but FWIW, here's my index.html file in the mailgraph directory:
Code:
<html>
        <head>
                <title>SMTP4 Mailgraph</title>
        </head>

        <body>
<!--#exec cgi="/var/[URL unfurl="true"]www/cgi-bin/mailgraph.cgi"-->[/URL]
        </body>
</html>

That is the correct full location of the mailgraph.cgi file. While the index page loads (I get the correct title), I don't see the pretty graphs. Also, as I say, there are no errors in the logs.
 
I believe you only need to use the relative path and not the full path to your .cgi script.

So it would probably just be /cgi-bin/mailgraph.cgi

but I don't do much SSI :)
 
Yes, I tried the shorter path initially. Made no difference, and I'm sure that using the full path wouldn't break anything (it should fix things, often).
 
What extension are you using for the file that calls the cgi script. If it includes ssi, I think it needs to have the .shtml extension so apache knows how to parse it. Another way to do what you want is to allow cgi to be executed in your html directory. To do this, uncomment or add this line:

AddHandler cgi-script .cgi

This allows for cgi to be executed outside of the cgi-bin directory. Next you will need to tell apache where you would like cgi executed. Add this to the directory container where your script is located:

Options +ExecCGI

I am having a hard time accepting that you are getting no errors. Apache should be telling you that it couldn't find the script or for some reason couldn't execute it. Is there any chance that your logs are being written some place other than where you are expecting them?


 
I'm with RhythmAce. I don't think your ssi is functioning.

Make sure your httpd.conf includes
Code:
AddHandler server-parsed .shtml
AddType text/html .shtml

Options +Includes
Either globally, or put the Options +Includes in a <Directory> Tag

Test it with a simple
<!--#include file="anotherFileInSameDir"-->
Then move onto your mail cgi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top