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

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.

  • On 16.04 you should not need the AddType line, as it should already be in /etc/apache2/mods-available/mime.conf. However, you do need to add Includes to your Options line. – Doug Smythies Nov 26 '17 at 16:41
  • Now it works!! Thanks for your time to look into the problem – Donjin Nov 27 '17 at 2:49

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   

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.