Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Cannot get SSI working with index.shtml

Cannot get SSI working with index.shtml
Thread Tools
Forum Regular
Join Date: Jan 2001
Location: Sacramento, CA, USA USA USA
Status: Offline
Reply With Quote
Aug 28, 2003, 12:47 PM
 
Ive gone through the o-reilly page of how to set up SSI for cgi scripts. I can get my test-cgi script to run, but cannot get it to run as an included file in my index.shtml. i can get my index.php working, though.
heres my code:

Code:
html body h1 Gleefully crap /h1 pre !--#include file="news.txt" -- !--#include virtual="/cgi-bin/test-cgi" -- /pre /body /html
edit:had to remove the greater tahn/less than signs in the code

all that comes up for me is the "gleefully crap"

the page is www.daveninja.com/index.shtml
the test-cgi will run if you goto www.daveninja.com/cgi-bin/test-cgi

Ive done the changes to the httpd.conf file and restarted the apache server.
copy of the httpd.conf file is at www.daveninja.com/httpd_conf.txt

please help

-daveninja
daveninja.com
     
Forum Regular
Join Date: Oct 2002
Status: Offline
Reply With Quote
Aug 28, 2003, 01:19 PM
 
The first thing you should do is look at the spit out source code: It is still showing your SSI tags in the browser, meaning the server did not parse it. If you'd made a mistake it will print out something like [an error occured processing this directive], but your page is just spitting out the page unprocessed.

If that's a copy of your conf file, you don't have 'includes' in the directory definitions.

You have:
Options Indexes FollowSymLinks MultiViews

You want
Options Indexes Includes FollowSymLinks MultiViews
     
Forum Regular
Join Date: Jan 2001
Location: Sacramento, CA, USA USA USA
Status: Offline
Reply With Quote
Aug 28, 2003, 01:35 PM
 
Thanks, that fixed it.

is there a way i can add html files in a different directory to use the SSI and not have to rename them shtml or allow all my html files to be looked at as having SSIs?
daveninja.com
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Aug 28, 2003, 03:20 PM
 
Originally posted by DaveNinja:
Thanks, that fixed it.

is there a way i can add html files in a different directory to use the SSI and not have to rename them shtml or allow all my html files to be looked at as having SSIs?
Easy enough. Look for this in your httpd.conf:

Code:
AddHandler server-parsed .shtml
Add a second, similar line, but with .html:

Code:
AddHandler server-parsed .shtml AddHandler server-parsed .html
Do this with caution however -- remember that you incur a performance hit when you add server-side parsing. If you're going to serve static HTML pages as well, it may be worth it to keep their extensions separate.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:20 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2