9

I recently upgraded my Mac to OSX 10.10 Yosemite, which reset a bunch of settings I'd made for Apache, including my virtual hosts set up. I've restored all of that, but I'm still unable to get Server-side Includes working, where they worked fine under Mavericks and the previous Apache installation.

Here's an example of an include statement in my .SHTML files:

`<!--#include virtual="/includes/branded-header.html" -->`

Here's the httpd-vhosts.conf entry

`
<VirtualHost *:80>
    ServerName v12b.local
    ServerAlias www.v12b.local
    DocumentRoot "/Users/my-name/Sites/v12b"
    ErrorLog "/private/var/log/apache2/v12b.local-error_log"
    CustomLog "/private/var/log/apache2/v12b.local-access_log" common
    ServerAdmin my-name@myco.com
<Directory "/Users/my-name/Sites/v12b">
    Options Indexes FollowSymLinks Includes
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
    AddType text/html .shtml .html
    AddOutputFilter INCLUDES .shtml .html
    AddType application/x-httpd-php .html
</Directory>    
</VirtualHost>`

I've checked Apache documentation and other guides, so my username.conf and httpd.conf files look to be in order. Any help would be greatly appreciated.

thanks!

John Egan
  • 225
  • 1
  • 11

2 Answers2

9

I was able to find an answer on an Apache forum, so I thought I'd share it here.

LoadModule include_module libexec/apache2/mod_include.so

I missed removing the comment on this line in my httpd.conf file. Once I removed the comment and restarted Apache, everything started working again.

Looks like 2.4 is a pretty big upgrade from 2.2, with lots of changes. Hopefully, someone else might find this helpful.

John Egan
  • 225
  • 1
  • 11
0

This upgrade guide provided the SSILegacyExprParser option that works inside of an .htaccess file: https://httpd.apache.org/docs/2.4/upgrading.html#config

<IfModule mod_include.c>
SSILegacyExprParser on
</IfModule>
zachleat
  • 3,318
  • 1
  • 23
  • 20