OSX Yosemite, Apache 2.4 and server-side includes

Discussion in 'Web Design and Development' started by grizfan, Oct 22, 2014.

  1. grizfan macrumors member

    grizfan

    Joined:
    Feb 10, 2012
    Location:
    Boise, ID
    #1
    I just updated my iMac to Yosemite. The upgrade from Apache 2.2 to 2.4 has caused a few issues. I was able to fix most, but I'm still having problems with server-side includes. I'm using the built in Apache, and have setup httpd-vhosts.conf and configured my hosts file set up to allow for multiple dev sites. Pages load, but my .shtml files are not even attempting to process the include virtual statements.

    statements like this in my .shtml files are not getting processed:

    Code:
    <!--#include virtual="/includes/branded-header.html" -->
    in my vhosts.conf file, each directory has the following:

    Code:
    <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>
    
    from what I've read, this should be working. I've tried a few different combinations, and I just can't get my includes to fire.

    any help would be greatly appreciated.
     
  2. grizfan thread starter macrumors member

    grizfan

    Joined:
    Feb 10, 2012
    Location:
    Boise, ID
    #2
    Code:
    LoadModule include_module libexec/apache2/mod_include.so

    I missed removing the comment on this line in my httpd.conf file.
    At least I now know a lot more about configuring Apache.
     

Share This Page