Solved

SSI Problem

Posted on 1997-11-26
14
458 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
[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
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
How To Reduce Deployment Times With Pre-Baked AMIs

Even if we can't include all the files in the base image, we can sometimes include some of the larger files that we would otherwise have to download, and we can also sometimes remove the most time-consuming steps. This can help a lot with reducing deployment times.

 

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

Stack Overflow Podcast - Frustrating Miracles

In this podcast, Stack Overflow interviewed Linux Academy CEO/Founder, Anthony James, and got his developer story!

"Follow your passion, be prepared to work hard and sacrifice, and, above all, don't let anyone limit your dreams."  - Donovan Bailey

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 make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

630 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