Link to home
Start Free TrialLog in
Avatar of talyn
talyn

asked on

SSI Problem

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?
Avatar of talyn
talyn

ASKER

Edited text of question
Avatar of talyn

ASKER

Edited text of question
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
Avatar of talyn

ASKER

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?


Are you positive that your server support SSI?

"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.
Avatar of talyn

ASKER

Adjusted points to 175
Have you added:
AddType text/htmlk .shtml
AddHandler server-parsed .html

to srm.conf?
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


Avatar of talyn

ASKER

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.

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"-->
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
Avatar of talyn

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of fln
fln

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial