Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Apache CGI Works alone, but not in HTM file

Posted on 1999-07-09
3
Medium Priority
?
226 Views
Last Modified: 2013-12-25
I'm migrating from a WN server to an Apache server. I have several scripts which ran fine on WN, but on Apache, they don't.  

In order to attempt to understand what's going wrong, I downloaded the simplest CGI I could find - a text counter (countit.cgi).  I was able to set it up and get it to work on its own eg, http://www.blah.com/countit.cgi, however, if I try to get the text embeded in an HTML file, nothing gets returned.  When I look at what the server returned inside the HTML file, I see that it didn't do anything with the exec statement.  I also tried the include virtual as listed in the apache.org docs on the subject (i.e., <!--#include virtual="cgi-bin/counter/countit.cgi" --> ) and that did the same thing, the text <!--#include...etc.. is included in the HTML returned, and not interpreted by PERL.

What's goin' on here?

Bill
:-=>  
0
Comment
Question by:Bigpaws
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
djsansui earned 400 total points
ID: 1834968
Are you setting up the Apache server?  If so there are several things you must do to make SSI work.

in httpd.conf, you must add:
    Options Includes
to the base directory settings (it looks like <Directory "c:/htdocs"> or whatever is the location of your web folder)

Then uncomment the lines:
AddHandler server-parsed .shtml
AddType    text/html     shtml


you should be all set to use SSI then.  If you are new to Apache, I suggest you read httpd.conf to learn a little bit about what you can do with it.  You'll probably stumble upon dozens of useful features.

also, I've had more luck using the directive <!--#exec cgi="/cgi-bin/start2.cgi" --> than the include directives (when executing a CGI). Good luck, you should be parsing in no time.
0
 

Author Comment

by:Bigpaws
ID: 1834969
I'm not actually the one setting it up.  Does this mean, once I get the admin to set it up, all the files have to be named .shtml?  
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6873127
GREETINGS!

This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Vim Reference Guide

Vim is a powerful text editor favored by many sysadmins and developers - here are some commands that you'll want to keep in your back pocket!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article will show, step by step, how to integrate R code into a R Sweave document
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question