Enabling Server Side Includes (Ssi) in Ubuntu 16.04 Is Not Working

I have an html page with SSI and I was trying for enabling SSI in my apache (V 2.4.18) running on Ubuntu 16.04. As per the offical documentation, I tried editing /etc/apache2/apache2.conf and now included following directives,

<Directory /var/www/>
Options FollowSymLinks
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml 
AllowOverride None
Require all granted
</Directory>

But it was not successful. Also, I tried the direction from here, here and a few similar posts. Unfortunately, it was also failed to enable SSI. Anyone can direct me to solve this issue?

Note: First, I posted it in Server fault (post), but couldn't get a response and I decided to AskUbuntu.

2

1 Answer

This is how i did it using server side includes

  1. Include your html page inside body:

    <!--#include virtual="mypage.shtml"-->
    
  2. Enable the Include and Include.load module

    sudo a2enmod include
    sudo a2enmod include.load
    
  3. Edit: /etc/apache2/sites-available/000-default.conf

    Paste below lines inside VirtualHost Tag:

    AddOutputFilter INCLUDES .php 
    
  4. Edit your .htaccess: Paste below line:

    Options +Includes 
    
  5. Restart your apache by typing:

    sudo service apache2 restart   
    

Note:
I am using php with ubuntu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest