• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

SSI on Apache 2.2.27 not working

LEGEND ,
Aug 16, 2016 Aug 16, 2016

Copy link to clipboard

Copied

Hello, all,

This is my first time trying anything with SSI.

I have Apache 2.2.27 running on Windows (C:\apache), and I have been following a few blogs/posts on how to configure Apache to use server-side includes.  I believe that I have everything as it should be.

In C:\apache\conf\httpd.conf:

I uncommented "LoadModule include_module modules/mod_include.so"...

ServerName 127.0.0.1:80

DocumentRoot "C:\ColdFusion10\cfusion\wwwroot"

In my DIRECTORY, I changed the following:

Options FollowSymLinks

to:

Options FollowSymLinks Options

In my DIRECTORY "C:\ColdFusion10\cfusion\wwwroot", I changed the following:

Options Indexes FollowSymLinks

to:

Options Indexes FollowSymLinks Includes

I added the following to an IfModule tag:

AddType text/html .shtml

AddOutputFilter INCLUDES .shtml

Then, I create a .shtml file called "menu.shtml", place a few lines just for testing, and include it in another file "csstest.html":

<!--#include file="menu.shtml" -->

.. and it does not work.  At all.

What am I missing?

V/r,

^_^

UPDATE: Before anyone asks.. yes, I did stop and restart the Apache service before coming here to ask.   

Views

488

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 18, 2016 Aug 18, 2016

Copy link to clipboard

Copied

Has anyone managed to get SSI to work on Apache 2.2?  Am I missing something in a conf file?

V/r,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 19, 2016 Aug 19, 2016

Copy link to clipboard

Copied

LATEST

Well.  I finally discovered why it wasn't working.

Of the code samples and tutorials that I reviewed in my research for using SSI, I do not recall any of them specifically stating or implying that the parent file must have a .shtml extension.  It showed examples of the file to be included having a .shtml extension, but nothing about the file that includes another doing so.

So.. just in case anyone else has this issue, it must be used as such:

main.shtml (parent file):

<!--#include file="child.htm" -->  or <!--#include virtual="/test/child.shtml" -->

Note that there must be a space between the last quote of the last variable and the closing comment code.  "file" is if the child file is located in the same folder as the parent file; "virtual" is if the child file is in a different folder.

If the child file is not going to be doing any more SSI processing, it can be a .htm or .html file; if it will do more SSI processing, like including the current date/time, then it must be a .shtml file, as well.

HTH,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation