10.5.2 Server-side Includes (SSI) not working?

We recently upgraded Leopard Server to 10.5.2, and now it appears as though SSI is not working.

I have the include module turned on, I have SSI active for the site. Everything was working correctly prior to the update, but now, the included text does not display.

If I view the page source, the <!--#include ... --> text is displayed as part of the source instead of the actual text that should be included.

I've tried turning off SSI for the site and reactivating it, but that didn't help. The same with the include module.

Has anyone else encountered this? Does anyone have any suggestions?

XServe, Mac OS X (10.5.2), Dual G5

Posted on Feb 20, 2008 2:49 AM

Reply
9 replies

Mar 7, 2008 7:49 AM in response to dchretien

I think I just solved your issue. I was having the sam problem as well.

I opened the http.conf file, went to the section where you see "AddHandler server-prased shtml" and added a new line, "AddHandler server-prased html" (we didnt name these files with the 's')

I also went to the <Directory "/"> section and added "Includes" to the options.

I restarted Apache, and it now works.

I hope it works for you too.

Mar 7, 2008 8:25 PM in response to Matt F.

Thanks for the suggestion. I will check the config file to make sure that it's correct, but I had already identified shtml to be parsed, and had made sure that all of my files that contain "includes" are tagged as shtml.

I might have to turn parsing on for html files, just to make it work, but that means that every page must be examined by the server prior to displaying it.

I will make sure that the settings from Server Admin are reflected in the config file. That could very well be the problem.

Thanks again.

Apr 16, 2008 8:32 PM in response to cstapp

Hi all

I've been searching and searching - I'm totally baffled by my problem, which might be related to what I've read here.

On my G5, I successfully configured my server and multiple virtual hosts, etc. When I got my MBP about a year ago, I intended to duplicate my setup. (btw, both machines are running Tiger). I do have my various sites loading on their respective ports however the server side includes are not working. I'm quite certain that httpd.conf is correctly configured:

LoadModule includes_module libexec/httpd/mod_include.so

<Directory />
Options FollowSymLinks Includes
AllowOverride All
</Directory>

Options Indexes FollowSymLinks MultiViews Includes

AddType text/html .shtml
AddHandler server-parsed .shtml

... however, the SSI are simply not working. The .shtml docs are dupes of the working version on my live site (remote server) so I know the markup is solid (I'm fairly expert w/html/css). Also, I've been working through a php tutorial (I'm a php newbie) so, while php is obviously installed and working, php includes also fail. The error log reports no missing include.

What else can I do to track down the cause of this or identify my mistake if I've made one? Is this possibly a bug? If anyone can shed some light I'd be mucho grateful.

thx, sr

Jun 19, 2008 9:59 PM in response to dchretien

OK, so I'm experiencing the same exact problem described by the initial poster. My configuration is on a clean install of Mac OS X 10.5.3 Server with all apache settings set from the Server Admin app. My CGI scripts can execute, I can't get directory indexes working, and includes don't work either, instead only displaying the html comment in their stead.

Based on previous OS X Server experience, I remembered that previous Server Admin versions compartmentalize site settings and tries to not alter the primary httpd.conf much if any (10.5 seems to modify the http.conf extensively). So instead it creates little conf files for each site. I had a look at some of mine. (You can find yours with `locate .conf` from the shell.)

My site conf files were in the default location:
/private/etc/apache2/sites/0000 any_80.conf.default
/private/etc/apache2/sites/0000 any_80site1.com.conf
/private/etc/apache2/sites/0001 any_80site2.net.conf
/private/etc/apache2/sites/0002 any_80site3.org.conf

Much to my confusion, the conf files contained the following, which if loaded properly, would of course allow includes, indexes, and cgi to work.

<Directory "/Library/WebServer/Documents">
Options All +Includes +ExecCGI +MultiViews +Indexes
AllowOverride All
<IfModule mod_dav.c>
DAV Off
</IfModule>
</Directory>

Also in my settings, I've enabled the shtml handler mentioned in another post and set the type (which are also listed in the .conf file)

It seems that not only do includes not work, but any SSI directives. No echos, no execs, no includes, nada. I don't really know what's wrong and why the settings don't work.

CORRECTIONS!

While writing this post and looking around inside files and whatnot I realized my specific problem relates to recursive includes (one include file that includes other files (not the same file including itself; I'm not crazy :] )). Anyway, I keep my global include files in an aliased directory so they can be shared across multiple sites. Well, when Server Admin creates aliases to directories, those directories don't (and couldn't) inherit the permissions of the primary document root. So essentially, they have no <Directory> tag in the site.conf files. As soon as I added one, sadly manually, and restarting the Web service, like magic all the includes started popping in.

Ideally in an update to Server Admin.app, those directory options checkboxes could be added to the new/edit alias dialog. Then you wouldn't have to modify the site file manually, or use .htaccess files; however that may be a better solution anyway.

Recursive include support was added to Apache in 2.0.

P.S. I'll leave the top part of my post for informational purposes.

Aug 7, 2008 5:31 PM in response to dchretien

Within your server admin settings (SA:Web:Settings:MIME Types, what is your Content hHandler set to for server-parsed? The default is shtml (.shtml, but we will forgive Apple's Server group for not having qualified commercial web hosting technicians on staff). If your suffix mapping is different, then what is your file suffix code using SSI?

Have you also confirmed that the MIME Types for shtml (or whatever your suffix map expectation is, is set to text/html under the upper MIME Types section?

You shouldn't have to go CLI on this particular part of the server admin. But if you make changes here, it can overwrite whatever CLI edits you have made prior. And Apple's server upgrade from Tiger to Leopard did not respect customized suffix mapping done from within the SA proper, so there is no reason to believe point updates will necessarily respect your CLI changes, either.

Presumably, you cloned your install before you applied the update. Reboot on that cloned drive -- are you sure it was working back then? If so, confirm its settings, then reboot in the updated volume and double-check your settings.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

10.5.2 Server-side Includes (SSI) not working?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.