Solved

SSI Problem

Posted on 1997-11-26
14
438 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
Comment Utility
Edited text of question
0
 

Author Comment

by:talyn
Comment Utility
Edited text of question
0
 
LVL 4

Expert Comment

by:unicorntech
Comment Utility
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
 

Author Comment

by:talyn
Comment Utility
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
Comment Utility
Are you positive that your server support SSI?

0
 
LVL 5

Expert Comment

by:julio011597
Comment Utility
"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
Comment Utility
Adjusted points to 175
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 1

Expert Comment

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

to srm.conf?
0
 

Expert Comment

by:jraywco
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
ok an answer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

728 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

14 Experts available now in Live!

Get 1:1 Help Now