opensuse 12.2/apache can't get server side includes working


I’ve had a webserver (apache) running on opensuse12.2 for awhile now. I’ve developed a need to use Server Side Includes (SSI). I’ve followed the documentation on the website to enable “Includes” and XBitHack. I’ve set up a file called htdocs.conf in /etc/apache2/conf.d/ which contains the following (comments deleted for brevity):

<Directory “/srv/www/htdocs”>
Options Includes
XBitHack on
AllowOverride None
Order allow,deny
Allow from all

I’ve made the .html file I want included to be executable. I’ve stopped and started apache via the systemctl facility. I’ve tried testing the SSI with both:
<!–#echo var=“DATE_LOCAL” →

as well as with the actual .html file with:

<!–#include virtual=“xray_facility_header.html” →

However, when I paste the contents of the “xray_facility_header.html” into the index.html, it comes up OK. This seems to point to a problem with the SSI configuration rather than a problem with the included file.

This a rather vexing problem because there are no error messages anywhere.:mad: I’ve also tried the AddType AddHandler method which outlined in the apache docs. I would prefer to stay with XBitHack if possible. Thanks for any help.



Some notes on how to communicate computer texts (as you have them here) on the forums. Allways copy/paste them from a terminal window into a post between CODE tags. You get the CODE tags by clicking on the # button in the tool bar of the post editor.

Hi pboyle4848,

I just tested with my 12.2 installation and the XBitHack option and the DATE_LOCAL line worked as expected. I can think of three possible causes for your problem:

  • Is the “include” module loaded? The APACHE_MODULES variable in /etc/sysconfig/apache2 must contain “include” somewhere. However, if it isn’t there, I would expect apache to emit some warning messages on startup due to unknown configuration directives.
  • You’ve written “I’ve made the .html file I want included to be executable.” Surely you mean the file which contains the SSI directive (there is no need to make the file you want to be included executable, unless it contains SSI comands as well).
  • Is your config file parsed? I find the openSUSE apache default config rather complicated: Your file should be included by default-server.conf, which in turn gets included by httpd.conf, which is the main apache config file. If you modified this scheme (maybe earlier, you’re writing you’ve been using apache for quite a while now), make sure conf.d is included somewhere in your config.

If this is not helping, load the “info” module (with APACHE_MODULES, see above) and look in http://localhost/server-info to determine if “include” is loaded and XBitHack is set (maybe you have to move XBitHack out of the <Directory> scope).