Solved

SSI Problem

Posted on 1997-11-26
14
446 Views
Last Modified: 2013-12-25
I am trying to call SSI from an html document (I've tried .html, .htm, .shtml, .shtm). I keep getting the following error "[an error occurred while processing this directive]" I have looked at my .htaccess file and I think it's set up correctly. I can run non-ssi scripts fine, but #exec and #include SSI calls don't work. Other SSI calls work fine, except those two. I'm not too experienced with SSI so I am seeking an answer desperately. I've been to "http://hoohoo.ncsa.uiuc.edu/docs/setup/access/Overview.html" for more info and have tried everything I could find. I still get errors. Any help?
0
Comment
Question by:talyn
14 Comments
 

Author Comment

by:talyn
ID: 1831444
Edited text of question
0
 

Author Comment

by:talyn
ID: 1831445
Edited text of question
0
 
LVL 4

Expert Comment

by:unicorntech
ID: 1831446
This error occurs 95% of the time due to a permissions problem. Make sure the user running httpd owns the script and that the script that the html document calls is executable,

Regards,

Jason
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:talyn
ID: 1831447
The permissions of the scripts are set correctly as are all the paths within the scripts themselves. I can run the admin.cgi script to set stuff up since it's called directly, but once I try to call a script named:  amslite_ssi.cgi by the following method:

<!--#exec cgi="cgi-bin/ams/amslite_ssi.cgi"-->

or

<!--#include virtual="cgi-bin/ams/amslite_ssi.cgi"-->

it gives me an error.

I have my own virtual domain with full access and executable rights set. I'm thinking it's a .htaccess configuration problem or lack of configuration?

Do I need to set 'Options' or a <Limit> identifier?


0
 
LVL 2

Expert Comment

by:df020797
ID: 1831448
Are you positive that your server support SSI?

0
 
LVL 5

Expert Comment

by:julio011597
ID: 1831449
"cgi-bin/..." means that cgi-bin is a directory under your page's directory.

Maybe you mean "/cgi-bin/...", which means cgi-bin under the web server root.
0
 

Author Comment

by:talyn
ID: 1831450
Adjusted points to 175
0
 
LVL 1

Expert Comment

by:fln
ID: 1831451
Have you added:
AddType text/htmlk .shtml
AddHandler server-parsed .html

to srm.conf?
0
 

Expert Comment

by:jraywco
ID: 1831452
Is this your own server? Are you using Apache? If this is not your server, are all SSI functions made available to you? Have you tried the complete SERVER path to the file? ie /home/username/cgi-bin/filename (or whatever)

John Ray - jraywco - jray@wco.com


0
 

Author Comment

by:talyn
ID: 1831453
fln has the right answer. For some reason I had to separate the line in the .htaccess file.

I had AddType text/html server-parsed html .shtml which is what I found when going through some documentation.

When I separated the lines as fln pointed out, it worked? The server is an Apache running Linux.

fln if you wish to post that as an answer I will award the points to you.

0
 
LVL 1

Expert Comment

by:maholt
ID: 1831454
These two includes were in a posted comment, so I am assuming that these are the items in question.
<!--#exec cgi="cgi-bin/ams/amslite_ssi.cgi"-->
<!--#include virtual="cgi-bin/ams/amslite_ssi.cgi"-->

Permissions you said are correct but the first problem would be finding the script in the first place.  If you use virtual you have to give an absolute path name AND it cannot be an executable/script.  The include SSI will only allow text/html files to be included.  As for the exec, this should be an absolute path as well.

So to get these two to work.  First copy amslite_ssi.cgi to amslite_ssi.txt into some directory that your web browser has read access, so that the virtual statement will work.  Then try
<!--#include virtual="/~home/ams/amslite_ssi.txt"-->

For the exec try
<!--#exec cgi="/cgi-bin/ams/amslite_ssi.cgi"-->


This assumes that the amslite_ssi.cgi is in the web servers cgi-bin directory.  If it is not and the cgi-bin directory is really a local directory that you have read acces to, then try these: (you still need copy the file for the plain include to work)
<!--#exec cgi="./cgi-bin/ams/amslite_ssi.cgi"-->
<!--#include file="cgi-bin/ams/amslite_ssi.txt"-->
0
 

Expert Comment

by:brendanmc
ID: 1831455
First off, .htaccess has nothing to do with SSI - that is for password protected directories.

Anyways it sounds like the problem you are having is that the script you are trying to run doesnt have the right permissions set on it. You need to execute a CHMOD 777 on the file you are trying to #exec.  this should solve the problem.
In case you arent familiar with CHMOD, there are two ways you can do it
the first is to telnet in if you have a shell account and type
CHMOD 777 <filename>
Or, use Cute FTP ( available at http://www.cuteftp.com ). open up your FTP account ,select the file you are trying to #exec, right click, select CHANGE FILE attributes, and in the box type 777 and OK...this should solve your problem
0
 

Author Comment

by:talyn
ID: 1831456
Sorry for the confusion, I had to create a global ACF in order to get the correct type and permissions for the directory I was working with. In this case I had a directory within the cgi-bin where the permissions where set wrong. When I mentioned .htaccess, I was mistaken. I made the changes within access.conf.

On my server you cannot chmod any executables to 777 since this may create a security problem. They must be chmod 755.
0
 
LVL 1

Accepted Solution

by:
fln earned 170 total points
ID: 1831457
ok an answer
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

815 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now