I'm trying to get SSI to work on Debian running Apache, however the .shtml
files are not being parsed. From a PHP file with phpinfo()
I can see that the following show up in the loaded modules section:
mod_mime_xattr mod_mime mod_mime_magic
In /etc/apache2/mods-enabled/mime.conf
I have (among other things):
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
In /etc/apache2/sites-enabled/domain.com.conf
(for the virtual host in question) I have:
<Directory /home/username/public_html>
Options +Includes
allow from all
AllowOverride All
</Directory>
and for good measure, I added the following as well:
<Directory />
Options +Includes
</directory>
In the user's .htaccess
file, I tried adding:
Options +Includes
AddType text/html shtml
AddHandler server-parsed shtml
Nothing seems to work. How can I even debug this?
Edit:
Here is the output of ls /etc/apache2/mods-enabled/
in case this helps
actions.conf dav_svn.load proxy_balancer.load
actions.load deflate.conf proxy.conf
alias.conf deflate.load proxy_connect.load
alias.load dir.conf proxy_http.load
auth_basic.load dir.load proxy.load
auth_digest.load env.load python.load
authn_file.load fcgid.conf reqtimeout.conf
authz_default.load fcgid.load reqtimeout.load
authz_groupfile.load mime.conf rewrite.load
authz_host.load mime.load ruby.load
authz_user.load mime_magic.conf setenvif.conf
autoindex.conf mime_magic.load setenvif.load
autoindex.load mime-xattr.load ssl.conf
cgi.load negotiation.conf ssl.load
dav_fs.conf negotiation.load status.conf
dav_fs.load php5.conf status.load
dav.load php5.load suexec.load
dav_svn.conf proxy_balancer.conf
In order to get server side includes to work, the
include
module also needs to be loaded. You can do this by executing the following as root:Or execute the following:
Then restart apache.
Note, if you were adding SSI to
.shtml
files from.htaccess
you would doAddOutputFilter INCLUDES .shtml
. Or substitute.shtml
for whatever file type you want to be parsed by the server side includes.The current Debian config file
/etc/apache2/mods-available/mime.conf
contains an error in that it adds the following:without first checking whether
mod_include.c
has been loaded. To get around this, you can change those lines to:The
<IfModule>
tags can be nested. This will get rid of the error messages that you are experiencing in the event thatmod_include.c
is not loaded.