skip to Main Content

I have ssi working on InMotionHosting but can not get it to work on a local Centros 7 install.
Apache version 2.4.6

The httpd -M shows that the so_module is loaded but not the mod_include.

When I tried to add mod_include I get the error:
httpd: Syntax error on line 55 of /etc/httpd/conf/httpd.conf: Can't locate API module structuremod_include’ in file /etc/httpd/modules/mod_include.so: /etc/httpd/modules/mod_include.so: undefined symbol: mod_include’

I tried to modify the httpd.conf file:

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    Options +Includes
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml

Still the SSI fails.

The index file is simple:

<h1>Test page</h1>
/var/www/index.html
<br/>
<!--#echo var="DATE_LOCAL" -->
<!--#include virtual="./insert.shtml" -->

What did I miss?

2

Answers


  1. Chosen as BEST ANSWER

    Got ssi to work on Centros 8 by setting XBitHack on.

    httpd.conf:

    <Directory "/var/www/html">
        Options Indexes FollowSymLinks
        AllowOverride All
        Options +Includes
        # AddType text/html .shtml
        # AddHandler server-parsed .shtml
        XBitHack on
         Require all granted
    </Directory>
    

    And in the /var/www/html do:

    chmod +x test.shml
    

    index.htm:

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

    Now .shtml files can be used.

    Server version: Apache/2.4.37 (centos)


  2. After a few more flops, I found this to work:

    AddType text/html .shtml

    AddHandler server-parsed .html

    All the examples that I found showed AddHandler server-parsed .shtml. My main file is index.html and the ssi file is test.shtml.

    Hope this has helped someone.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search